Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Answer: How can I make one class extend another one?

( #33057=categorized answer: print w/ replies, xml ) Need Help??

Q&A > object-oriented programming > How can I make one class extend another one? contributed by brother ab

package Child; use base qw(Mother Father);

base pragma not only includes extended classes in @INC, but 'require's them.

Additionally, it is integrated with fields pragma (if you like strict data members protection)

Comment on Answer: How can I make one class extend another one?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2015-07-04 22:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls