redirecting stdout/stderr to logfile

D

dmedhora

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
 
A

A. Sinan Unur

(e-mail address removed) wrote in @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 <[email protected]>
(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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top