redirecting stdout/stderr to logfile

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

  1. 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
     
    , May 25, 2006
    #1
    1. Advertising

  2. wrote in news:1148522375.388135.180740
    @u72g2000cwu.googlegroups.com:

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


    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. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon Landenburer

    redirecting stderr and stdout

    Jon Landenburer, May 12, 2004, in forum: Perl
    Replies:
    1
    Views:
    11,217
    Joe Smith
    May 13, 2004
  2. Jan Knop
    Replies:
    4
    Views:
    1,051
    Jan knob
    Nov 24, 2003
  3. Michael McGarry
    Replies:
    1
    Views:
    609
    Michael Fuhr
    Dec 16, 2004
  4. Lincoln Yeoh

    Redirecting stderr and stdout to syslog

    Lincoln Yeoh, Aug 5, 2008, in forum: Python
    Replies:
    2
    Views:
    2,131
    Lincoln Yeoh
    Aug 6, 2008
  5. Ian Hobson
    Replies:
    0
    Views:
    658
    Ian Hobson
    Sep 6, 2010
Loading...

Share This Page