in reply to Capturing warnings from Time::Piece
perldoc open talks about redirecting STDOUT/STDERR to a variable - at least in perl 5.8.
You may want to open another filehandle to STDERR before closing STDERR so that you can redirect STDERR to the original console again later. Or maybe not.my $err; close STDERR; open STDERR, '>', \$err; use Time::Piece; $time = Time::Piece->strptime('2005-02-24 23:000', "%Y-%m-%d %H:%S"); print "[$err]\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Capturing warnings from Time::Piece
by betterworld (Curate) on Feb 24, 2005 at 02:43 UTC |