Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by John M. Dlugosz (Monsignor)
on May 17, 2011 at 09:46 UTC ( [id://905233]=note: print w/replies, xml ) Need Help??


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).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://905233]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-25 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found