Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Inheritance confused

by exilepanda (Pilgrim)
on Dec 08, 2015 at 07:03 UTC ( #1149646=note: print w/replies, xml ) Need Help??


in reply to Re^3: Inheritance confused
in thread Inheritance confused

Thanks Apero,

The way you suggested can resolve the method calling issue. But this won't able to the make the {Parent} attributes shareable in different constructors in Lite in my case.

That said, with my Lite class, I might have

$admin = MyTest::Lite -> asAdmin( $id ); $user = MyTest::Lite -> asUser( $id );
where a data dump will give something like:
$admin => { Mode => 'Admin', CommonParentAttributes => {...} }, MyTest::Lite
and
$user => { Mode => 'User', CommonParentAttributes => {...} }, MyTest::Lite
I don't actually mind if Mode is written into the CommonParentAttributes (thus I don't need CommomParentAttributes at all) , but when $user is created, $admin's Mode will become 'User'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2020-02-18 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (79 votes). Check out past polls.

    Notices?