Well, are you sure you still have the database connected when the END block gets called ? Naturally you could reopen the database in the END block, but maybe the module you use for database access has "closed shop" at that time already. Any call into another module might trip over a die, I don't know what happens then
IMHO stuffing the END block is just not good style. I would use END only in small scripts, bigger programs should be written with few and well known exit points
If you have lots of die calls in your program it might be better to substitute the die calls with a subroutine that does the cleanup before dying. So that you can differentiate between normal and emergency (i.e. die) exit.
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.