Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 sharing their wisdom with the Monastery: (5)
As of 2024-03-29 15:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found