I have a script which runs mostly via a cron job and sometimes interactively.
I would like STDERR to automatically print to both the console and to a logfile
simultaneously.
Right now I've gotten as far as merging both file handles with IO::Tee but I'm
not sure if I'm heading down the right path.
my $merged_stderr = IO::Tee->new( \*STDERR, new IO::File(">>$errlog") );
This only works when explicitely naming the file handle in a print statement.
How can I take it to the next step, which is to have STDERR automatically print
to that file handle?
Any help would be appreciated.
Pablo
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/