hello
In case you've wondered, I'm not asking about biological immortality (although I wouldn't object to an answers for that too).
I'm using a module that sometimes uses the die function and shutting down my program all together.
My question is: Is there a way for me to call a function from that module (without changing it of course), and instead of dieing, having the string printed by that preformed die function, returned instead ?
I guess I want something like this:
my $die_Message = immortal( some_module_function( $param1 , $param2 , .. ) );
so if some_module_function died, the program wouldn't and instead store the die message in $die_Message,
and if it didn't die, it would simply preform the module's function
exactly like it would if "immortal" wasn't there (don't care much about the return in this scenario).
thx
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.