in reply to Logging Errors
This is pretty weird. Why would you log errors this way?
There is already a lot of very good work into logging things with CGI::Carp
I don't know if you are master hacker and you've got some spooky stuff going on. But if you're not- and you don't- Then I would suggest to use CGI:Carp and stay clear of re-inventing the wheel.
BEGIN { use CGI::Carp qw(carpout); open(LOG, ">>/var/log/yourlogfile") + or die("Unable to open yourlogfile: $!\n"); carpout(LOG);}
Yes, I know at first hand it doesn't seem to replace anything. But, you could always record to a log, and run a script on cron that greps out sections to flat files- whatever.
If you must though... CPAN has IO::Capture::Stderr - Capture all output sent to STDERR. No perl minion should feel safe even going to take a sh&t before I searching CPAN for the right toilet paper to wipe your a55. And it's free. Like the one you steel from work.
Hope this helps.. ?
|
|---|