Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: how i capture a script error to a file ?

by hippo (Bishop)
on Apr 27, 2017 at 16:16 UTC ( [id://1189063]=note: print w/replies, xml ) Need Help??


in reply to how i capture a script error to a file ?

did this, but dont work

Of course it works:

$ ls log.err ls: cannot access log.err: No such file or directory $ cat dieonpurpose.pl #!/usr/bin/env perl use strict; use warnings; local $SIG{__DIE__} = sub { my $message = shift; system qq(echo "$message" >> log.err); }; die "Afghanistan bananastand\n"; $ ./dieonpurpose.pl Afghanistan bananastand $ cat log.err Afghanistan bananastand $

"It doesn't work" is as useful to a developer as "I'm ill" is to a medic. Try to be specific.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-03-28 14:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found