I don't see
do_the_other_thing could have been executed because of the typo. I get, as I should,
Can't locate object method "caught" via package "My::Excpetion::Thingy
+" (perhaps you forgot to load "My::Excpetion::Thingy"?) at script.pl
+line 8.
True, it's a runtime error, but that's necessary since functions can be loaded at any time (including through AUTOLOAD) and @ISA can change at any time. Perl has no way of knowing at compile-time whether My::Excpetion::Thingy->caught will be valid any or all times that statement will be executed.
For example, I sometimes do:
if ($@) {
require Carp;
Carp::croak(...);
}
Carp::croak doesn't exist until the require is executed, which is only executed at run-time when the exception occurs. A compile-time check would think this is an error. However, I'll cede that it could be useful for lint to give an (overridable) *warning*.
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.