Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Problems? Is your data what you think it is?
 
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


Comment on Re^2: Understanding module structure and inheritance
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (12)
As of 2014-04-18 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (468 votes), past polls