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

Re^2: goto superclass method

by ikegami (Pope)
on Dec 22, 2004 at 18:11 UTC ( #416850=note: print w/replies, xml ) Need Help??


in reply to Re: goto superclass method
in thread goto superclass method

search_isa() is simply @ISA, because can searches the whole inheritance tree of the supplied class.

use strict; use warnings; package AA; sub dostuff { print(scalar(caller()), $/); } package BB; package CC; BEGIN { our @ISA = 'AA'; } package DD; use vars qw(@ISA); BEGIN { @ISA = qw(BB CC); } sub dostuff { foreach my $super (@ISA) { #if (my $method = $super->can('dostuff')) { # -or- if (my $method = UNIVERSAL::can($super, 'dostuff')) { #print($super, $/); #print($method, $/); goto $method; } } } package main; #print(\&AA::dostuff, $/); bless({},'DD')->dostuff(); # Prints "main"

Replies are listed 'Best First'.
Re^3: goto superclass method
by Ovid (Cardinal) on Dec 22, 2004 at 18:29 UTC

    search_isa() is simply @ISA, because can searches the whole inheritance tree of the supplied class.

    D'oh! I knew that. Silly me :)

    Cheers,
    Ovid

    New address of my CGI Course.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2019-09-18 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (226 votes). Check out past polls.

    Notices?