Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Welcome to the Monastery
 
PerlMonks  

Re: Method inheritance

by moritz (Cardinal)
on May 11, 2012 at 17:21 UTC ( #970062=note: print w/ replies, xml ) Need Help??


in reply to Method inheritance

Inheritance only works for method calls, but what you do is a subroutine call.

This should work intead:

sub run { my $self = shift; $self->_dosomething; ... }

Or you can directly call one::_dosomething, but then there's no need for inheritance in the first place.


Comment on Re: Method inheritance
Select or Download Code
Re^2: Method inheritance
by alafarm (Novice) on May 11, 2012 at 17:33 UTC
    Thanks. What was confusing me is that (correct me if I'm wrong), if these two modules were not specified as "packages" and without the "@ISA", then the subroutine call would have worked.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (14)
As of 2013-05-22 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (454 votes), past polls