Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by water (Chaplain)
on Jul 18, 2004 at 19:29 UTC ( #375415=note: print w/ replies, xml ) Need Help??


in reply to Why is a hash the default "object" in oo perl?

I've been happy using Class::MethodMaker, and using the easily defined accessors / setters for all access into the object, both from outside, from inside (the class itself), and from any subclasses. Then nobody steps on anyone else. And given all the convenience functions C:MM offers, I'm not tempted to cheat and push stuff into hash directly.

You won't find the eight characters

$self->{
in my code, as I never go into $self as a hash. In fact, CMM could migrate itself to inside-out objects or blessed pumpkin bread or whatever, and I wouldn't even notice.

The only downside I can see to this is speed, but my apps are all disk-IO-bound anyway, so the extra wrapper calls don't matter a whit.

Your mileage may vary--

water, water, everywhere


Comment on Re: Why is a hash the default "object" in oo perl?
Select or Download Code
Re^2: Why is a hash the default "object" in oo perl?
by qq (Hermit) on Jul 19, 2004 at 18:52 UTC
      Wow.

      The Class::MakeMethods docs make my head spin!

      Class::MethodMaker isn't perfect, and is pretty basic, and has gaps in the docs, but Class::MakeMethods looks like it will take a bit to understand.

      Reminds me of the first time going through Template Toolkit docs -- it looks big, it looks good, it looks overwhelming. Soon the comprehensivesness becomes friend, not foe, but whew, alot to sink in. That's the feeling I get skimming numerous numerous Class::MethodMaker docs.

      Something new to learn eventually, methinks....

      water
      not just for breakfast anymore

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2014-07-26 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls