in reply to Re: caller package and eval
in thread caller package and eval

You mean just use if $class->isa instead of worrying about the caller. Thanks, that makes sense....I got too stuck copying example code I think.

Replies are listed 'Best First'.
Re^3: caller package and eval
by ikegami (Patriarch) on Sep 02, 2009 at 02:07 UTC
    I don't understand how isa fits in here. If you mean to do the following, it seems useless to me.
    package User; sub find { my ($class, $query) = @_; die("Bad class") if !$class->isa('User'); ... }

    Someone would have to put effort into making that condition fail.

      Yeah, I agree, it seems to be overkill and not really necessary. It seems I don't need the isa test at all, although I was trying to be protective inside my parent object. Thank you very much for your helpful responses.