redirecting stdout/stderr to logfile

Discussion in 'Perl Misc' started by dmedhora, May 25, 2006.

  1. dmedhora

    dmedhora Guest

    Hi all,

    I have a perl program in which I use Expect to log in to another
    computer
    and run a command. My mail perl program takes a few arguments on the
    command line. Most the of the output on screen is from the Expect
    module.

    I also take in values from the stdin

    How can I redirect the output on screen into a logfile ? Something like
    tee
    But from within the perl program itself ?

    So that whatever output is obtained on stdout/err is also redirected to
    a logfile?

    Thanks
     
    dmedhora, May 25, 2006
    #1
    1. Advertisements

  2. wrote in @u72g2000cwu.googlegroups.com:
    Since you don't show code, there isn't much we can say other than to point
    you to:

    http://search.cpan.org/~kenshan/IO-Tee-0.64/Tee.pm

    Also, see

    perldoc perlopentut

    Playing with STDIN and STDOUT

    Sinan

    --
    A. Sinan Unur <>
    (remove .invalid and reverse each component for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, May 25, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.