Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: log::log4perl capture warningsby Laurent_R (Canon) |
on Apr 29, 2015 at 20:16 UTC ( [id://1125167]=note: print w/replies, xml ) | Need Help?? |
Please note that "Illegal division by zero" is not a warning but an exception, i.e. a fatal error. With a warning, the script will usually print the warning and continue to execute. Not so with "Illegal division by zero": the program will immediately cease to execute (unless you trap the exception). Consider this one-liner:
As you can see, the final statement is not executed, we don't even "get there". Compare to this, where the error is trapped within an eval block: Here, the program does not die, but checking the value of the $@ makes it possible for the developer to possibly take other actions than just dying (for example if something can be recovered, so that the error should not be fatal).
Je suis Charlie.
In Section
Seekers of Perl Wisdom
|
|