Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: My proudest moment

by Dominus (Parson)
on Nov 05, 2007 at 18:40 UTC ( #649080=note: print w/ replies, xml ) Need Help??


in reply to My proudest moment

Something similar I often do in CGI programs and other utilities that are not attached to the terminal:

BEGIN { open STDERR, ">", "/tmp/$0-$$.log"; }
and then all die and warn messages go to the log file in /tmp.

To get this to work with Sys::Syslog you would need a little more machinery:

BEGIN { sub SLH::PRINT { syslog("err", $_[1]) } sub SLH::TIEHANDLE { return bless ["dummy object"] => "SLH" } tie *STDERR => "SLH"; }
And then everything written to STDERR gets passed along to syslog.

Disclaimer 1: I didn't actually try this.

Disclaimer 2: I never, ever use software written by Eric Allman.


Comment on Re: My proudest moment
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://649080]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2015-07-06 10:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (71 votes), past polls