Thank you for that $^S nugget
tye -
I shall faithfully inscribe this into all my $SIG{__DIE__}
handlers :-)
I agree with you that eval is essential, but I disagree
with you that $SIG{__DIE__} is a completely bad idea. Just think
of if like an eval { } or do_stuff round your entire code and
you could come to love it ;-) (If it actually worked that
way of course!)
I like $SIG{__DIE__} for CGI's in the form of CGI::Carp
which is really very useful - it would be tiresome to be doing that
with eval. I also like $SIG{__DIE__} so I can write scripts which mail
me when they've blown up!
I don't see how you would do it with an END block - perhaps you could
enlighten me there? How do you know in an END block whether
your program is dieing or just exiting and if you can tell how do you get the
value of $@ (presuming that some other destructor/END block
used eval)?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.