Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Trying to understand Perl Objects

by plobsing (Friar)
on Apr 07, 2009 at 03:18 UTC ( [id://755916]=note: print w/replies, xml ) Need Help??


in reply to Re: Trying to understand Perl Objects
in thread Trying to understand Perl Objects

When I used to roll my own OO, I would do this. I liked it because it (in combination with strictures) gave me compile time errors when I made a typo in a field name. With a similar error using a vanilla hash, you just keep getting undef or setting something that never gets read.

I didn't consider it opaque. All the fields in the object are nicely listed at the top of the module in a constant/enum statement.

I never roll my own OO anymore. Also, I realize now that low-level field access in enough places to make the above argument valid is probably a bad sign.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-29 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found