Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by brother ab (Scribe)
on Sep 19, 2000 at 09:20 UTC ( #33057=categorized answer: print w/replies, xml ) Need Help??

Q&A > object-oriented programming > How can I make one class extend another one? - Answer 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)

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
vrk takes a cookie from the platter on the sideboard.
Eily thinks vrk is a cookie monster
talexb thinks the term 'cookie monster' is unnecessarily drogatory ;) and takes a cookie as well. Mmmm. Delicious cookies.
[davido]: A tool as pretentious as Test::Perl::Critic ought not fail to install because one of its dependencies failed to pull in List::MoreUtils.
[davido]: ...and Clone.pm

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (13)
As of 2017-04-25 15:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (458 votes). Check out past polls.