[Chicago-talk] Class::Accessor uses a hashref - a question ofstyle
me at heyjay.com
Sun Jan 25 17:44:45 CST 2004
----- Original Message -----
From: "Jim Thomason" <jthomasoniii at yahoo.com>
To: "Chicago.pm chatter" <chicago-talk at mail.pm.org>
Sent: Sunday, January 25, 2004 1:57 PM
Subject: Re: [Chicago-talk] Class::Accessor uses a hashref - a question
> > Now the question: Is it just a personal preference
> > to use a hash or a
> > hashref when creating a class. Or is one one syntax
> > preferred by those
> > people who make the rules?
> As far as I'm concerned, it's a personal preference.
> Some people prefer it, since you're passing by
> reference instead of by value. Realistically? As long
> as those hashes or keys or values or whatever aren't
> huge, it's not going to make a difference 99 times out
> of 100. Speed and memory won't be perceptibly
> I've also heard it used in times where someone wants
> to keep open the option of passing in additional
> arguments outside of that hash value.
> ($class->new(\%args, $someothervar)). Again, I'd
> personally rather stick 'em in that args hash.
> The only other possible advantage I can conceive of is
> that you're not required to de-reference a hashref if
> you already have one.
> I'd say that consistency is usually more important
> than one or the other. Pick one and stick with it, if
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!
> Chicago-talk mailing list
> Chicago-talk at mail.pm.org
More information about the Chicago-talk