jffry has asked for the wisdom of the Perl Monks concerning the following question:
My problem was this: I mispelled a class. More specif., I mispelled an exception class after an eval. For example:
You see, My::Exception::Thingy was being caught, but my code was executing do_the_other_thing(); because I mispelled "Exception" in my ->caught().eval { $obj->method() }; if ($@) { if (my $exception = My::Excpetion::Thingy->caught()) { do_something(); } else { do_the_other_thing(); } }
My big picture questions are these. I am guessing that B::Lint would have to be aware of Exception::Class class definition syntax to catch this. If I wanted Lint to help me with Object::InsideOut syntax that situtation would be the same. Has stuff of this nature already been completed? My CPAN and Google searches haven't yielded anything. Is there some other easier way that I'm missing? If there is no easy answer, does Perl 6 offer an improvement?
I guess the essential nitty-gritty thing is: when using Perl OO, am I stuck catching typos as runtime bugs?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl OO Lint
by ikegami (Patriarch) on Mar 13, 2006 at 18:00 UTC | |
by jffry (Hermit) on Mar 13, 2006 at 21:23 UTC | |
by ikegami (Patriarch) on Mar 13, 2006 at 23:13 UTC | |
by jffry (Hermit) on Mar 14, 2006 at 18:05 UTC | |
|
Re: Perl OO Lint
by diotalevi (Canon) on Mar 13, 2006 at 23:46 UTC |