Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

(tye)Re: OO-style question

by tye (Cardinal)
on Dec 30, 2000 at 00:58 UTC ( #48894=note: print w/ replies, xml ) Need Help??


in reply to OO-style question

To answer this question well, we need more concrete information so we can make a call as to whether A is a B, B is an A, A is a Base, B is a Base, etc.

But another option is that B can dispatch to A in any number of ways. The two simplest are:

sub B::same { goto &A::same } # or *B::save= \&A::save;
I'll add that inheritance, especially in Perl, should be saved as a last resort. Perl's inheritance is just way too clumsy, being very all-or-nothing.

        - tye (but my friends call me "Tye")


Comment on (tye)Re: OO-style question
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2014-12-25 03:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls