in reply to Re: My AUTOLOAD doesn't work in newer Perls. How to fix?
in thread My AUTOLOAD doesn't work in newer Perls. How to fix?

I see what you mean. I don't expect it to trap an error in the dispatched function. I worry about an error in the goto itself, not finding the target or "going" there.

Can that happen? I guess if $f is indeed not still undef and is a code ref, that should be good enough?

Thanks.

Replies are listed 'Best First'.
Re^3: My AUTOLOAD doesn't work in newer Perls. How to fix?
by JavaFan (Canon) on May 17, 2011 at 12:16 UTC
    If you can live with just using &$f instead of goto &$f, then use that. (Just realize that &$f returns, while goto &$f doesn't - at least not to the place it was called from).
Re^3: My AUTOLOAD doesn't work in newer Perls. How to fix?
by moritz (Cardinal) on May 17, 2011 at 13:50 UTC
Re^3: My AUTOLOAD doesn't work in newer Perls. How to fix?
by ikegami (Patriarch) on May 17, 2011 at 17:35 UTC

    If $f is a code ref, you're good. Otherwise, $f is a symbol, and you can provide messages for !exists(&$f) and !defined(&$f).