Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Re: $functions xor $methods

by dada (Chaplain)
on Oct 30, 2002 at 11:34 UTC ( [id://209033]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: $functions xor $methods
in thread $functions xor $methods

something like this seems to work and doesn't require hardcoded names. it just grabs the first parent method (in @ISA order) it finds:
sub AUTOLOAD { no strict; my $METHOD; ($METHOD = $AUTOLOAD) =~ s/.*:://; foreach my $PARENT (@ISA) { if(defined &{$PARENT.'::'.$METHOD}) { goto &{$PARENT.'::'.$METHOD} } } }
either this, or use Damian's NEXT module.

cheers,
Aldo

King of Laziness, Wizard of Impatience, Lord of Hubris

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-28 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found