Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2018-05-27 06:08 GMT
Find Nodes?
    Voting Booth?