shyamasoni has asked for the wisdom of the Perl Monks concerning the following question:
Hello all, I want to display the output of perl Script on console as well as i want to save it on text file also. i got the code which is redirecting output to the text but it wouldn't shown on console as well. following is the code.
what else i had to do to get the output on both textfil as well as on console??? plz help.....open OLDOUT,">&", STDOUT; close STDOUT; open(STDOUT,">index.txt"); print "hello how are u??\n"; close(STDOUT); open (STDOUT, ">&",OLDOUT);
Update
I am working on Windows..
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl output on console as well as on text file
by Athanasius (Archbishop) on Jan 05, 2015 at 07:03 UTC | |
|
Re: Perl output on console as well as on text file
by choroba (Cardinal) on Jan 05, 2015 at 10:32 UTC | |
|
Re: Perl output on console as well as on text file
by karlgoethebier (Abbot) on Jan 05, 2015 at 11:49 UTC | |
|
Re: Perl output on console as well as on text file
by Laurent_R (Canon) on Jan 05, 2015 at 08:00 UTC | |
by shyamasoni (Initiate) on Jan 05, 2015 at 10:28 UTC | |
by Anonymous Monk on Jan 05, 2015 at 11:34 UTC | |
|
Re: Perl output on console as well as on text file
by BillKSmith (Monsignor) on Jan 05, 2015 at 21:03 UTC | |
by shyamasoni (Initiate) on Jan 06, 2015 at 05:00 UTC | |
by karlgoethebier (Abbot) on Jan 06, 2015 at 12:23 UTC |