Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: Inheritance confused

by exilepanda (Friar)
on Dec 08, 2015 at 07:03 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1149646]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found