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

Re: inheritance weirdness

by boo_radley (Parson)
on Jan 25, 2003 at 13:40 UTC ( #229839=note: print w/replies, xml ) Need Help??


in reply to inheritance weirdness

What is Foo a subclass of? Nothing, so the call to $s->SUPER::foo; is a call to die.
You might have your package inherit from UNIVERSAL, so you can take advantage of :
if ($s->SUPER::can("foo")) {$s->SUPER::foo ()}
This is probably because @ISA returns Foo::foo as a method when invoked on Baz (Baz, of course, not having its own foo); even though you expect it to be Baz::foo and thus have something interesting in its SUPER pseudoclass -- probably calling Bar::foo, and then finally Foo::foo. Of course, at this point, your script would still bomb out, because it'd still try to find a superclass for Foo.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2023-03-24 04:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?