in reply to Re: Re: What's your favorite method of passing parameters into a sub?
in thread What's your favorite method of passing parameters into a sub?

I think I mostly agree with that statement. However, I would also tend to think that passing in 1 hashref vs. 2*n parameters would be more efficient in some situations...mainly if the hashref of opts you pass in will also get forwarded into an internal serializer class method(s) or some such foo.
You mean, compared to the overhead of actually calling a sub? You'll have to create a far fetched example to make a significant difference. And there's of course always &func;.
I agree, it's ugly and pointless on a ->new( {option1=>'on'} ) call, where there is no strict set of parameters, just 'options', but on a class method, I would think it more desireable ->dostuff('param1', {option1=>'on', option2=>'0'}).
This confuses me. The first one suggests it's a constructor, and constructors often are class methods as well. So why is a hashref ugly in the first example, but more desireble in the second? (For me, they all subs - whether they are used as methods (either class or object) or not).

Abigail