Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Understanding module structure and inheritance

by friedo (Prior)
on Jan 30, 2008 at 14:54 UTC ( #665137=note: print w/replies, xml ) Need Help??


in reply to Re: Understanding module structure and inheritance
in thread Understanding module structure and inheritance

Contact inherits Main. That means the Contact namespace will also include a copy of all the symbols of the Main namespace plus whatever it defines for itself.

That's actually not how inheritance works in Perl. The parent class's symbols do not get exported to the child class. When a method is called on the child class with the arrow (->) syntax, if that subroutine is not defined in the child class, then Perl searches the parent class(es) for it, and then finally tries AUTOLOAD if that doesn't work.

Update: Fixed typo

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://665137]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2016-12-02 20:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (50 votes). Check out past polls.