in reply to Re^2: Perl OO Lint
in thread Perl OO Lint

What are you talking about? That code still gives the Can't locate object method "caught" via package "My::Execption::Lock::Exists" (perhaps you forgot to load "My::Execption::Lock::Exists"?) error message.

The if is never false (as you say) or even true, since perl dies from the type before the if expression gets completely evaluated. Similarly, the die is never reached, since the if encountered a fatal error.

I suspect the if was within eval's block.

Replies are listed 'Best First'.
Re^4: Perl OO Lint
by jffry (Hermit) on Mar 14, 2006 at 18:05 UTC
    I see what you mean. Well, damn. I have modified the code so much now that I don't have time to break it and go back to find out exactly what was going on. However, in that same program, I used to have an END{} subroutine that dealt with the same object. Like this:
    eval { $lock->remove() }; if ($@) { if (my $exception = My::Exception::Lock::NotFound->caught()) { warn $exception; } else { die $@; } }
    Maybe that had something to do with why I wasn't getting the object-method-not-found error?