Maybe I've trying to over-think things here (or import concepts from other languages ...)I'm trying to implement this: http://www.perl.com/pub/a/2002/11/14/exception.html?page=2
the script that uses the packages looks like this:
use Error qw(:try);
use RemoteException;
try {
somefunction(1);
} catch DeployException with {
my $ex = shift;
print "wibble\n";
} catch RemoteException with {
my $ex = shift;
print "dibble\n";
} catch WineException with {
my $ex =shift;
print "chinup\n";
};
sub somefunction {
my $h =shift;
throw WineException("hello world") if $h==1;
return;
}
So I'm trying to "bring" the DeployException, RemoteException and WineException into the same namespace? as the rest. Now it will not print "chinup"; rather stopping at the RemoteException clause.
Apologies, I now realise that I'm actually asking a question about Error.pm, not the use statement. Is there another package which is slightly more usable?
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.