Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Catching perl warnings and errors

by hotshot (Prior)
on May 26, 2003 at 08:33 UTC ( [id://260797]=note: print w/replies, xml ) Need Help??


in reply to Re: Catching perl warnings and errors
in thread Catching perl warnings and errors

I use perl module Sys::Syslog for sending any messages to syslog, it work great. I only want to catch perl errors (from within my scripts not by redirecting it from the command line)and send them to syslog the same way.

Hotshot
  • Comment on Re: Re: Catching perl warnings and errors

Replies are listed 'Best First'.
Re: Re: Re: Catching perl warnings and errors
by CukiMnstr (Deacon) on May 26, 2003 at 14:29 UTC
    oh. I understood something else from your first post...

    There are many ways to catch exceptions. You could use eval(), but using eval() will not work for warnings from the compiler, from the POD:

    Beware that using "eval" neither silences perl from printing warnings +to STDERR, nor does it stuff the text of warning messages into $@.
    Or you can use Error as nite_man suggests, but I just made a couple of tests and read the docs and compiler warnings don't seem to be handled by it.

    hope this helps,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-25 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found