ramya2005 has asked for the wisdom of the Perl Monks concerning the following question:
Dear Perl Monks:
I want to redirect both STDOUT and Error messages to a file and also display in the screen, when I run a perl script.
I know that using tee.exe will help in gettting this done. But this operation will not return the exit code of the script.
Does any body know an alternative way of doing this w.o using tee.exe?
------------------- UPDATE -----------------------
Note: I am using a Windows XP/2000 machine!
-----------------------------------------------------
Thanks!
I want to redirect both STDOUT and Error messages to a file and also display in the screen, when I run a perl script.
I know that using tee.exe will help in gettting this done. But this operation will not return the exit code of the script.
So I tried to do this.perl -w sample1.pl 2>&1 | tee stdout.txt
But it only redirects the STDOUT and error messages to a file (Not printing in the screen).perl -w sample1.pl > stdout.txt 2>&1
Does any body know an alternative way of doing this w.o using tee.exe?
------------------- UPDATE -----------------------
Note: I am using a Windows XP/2000 machine!
-----------------------------------------------------
Thanks!
Back to
Seekers of Perl Wisdom