Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Why is a hash the default "object" in oo perl?

by diotalevi (Canon)
on Jul 19, 2004 at 17:01 UTC ( #375615=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Why is a hash the default "object" in oo perl?
in thread Why is a hash the default "object" in oo perl?

I've used my subclass package name as a key to a child hash. So while my parent may say $self->{ 'key' } internally, I say $self->{ +__PACKAGE__ }{ 'key' } which works as long as my parent doesn't name their hash keys things like Foo::Bar.

# A "dumping" of such a structure. $self = { bar => ..., foo => ..., 'Foo::Bar' => { bar => ..., foo => ... } }


Comment on Re^4: Why is a hash the default "object" in oo perl?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2015-07-28 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls