On Mon, 26 Apr 2010 22:16:27 +0800, Tim Bowden wrote: > I've just realised I almost never use named arrays or hashes anymore. > It's almost always anonymous references instead. That lead me to wonder > what criteria experienced perl hackers have as to when to use a named > array or hash, and when to start with an anonymous ref instead. My very > informal criteria tends to be to use an anonymous ref from the start if > I'm going to be passing it to a sub, and a named array or hash > otherwise. I've found the former to be much more common. Thoughts?
I create arrays and hashes by default, not references to anonymous versions. I'd sooner not be putting arrows in unnecessarily. I can always enreference an aggregate in the call to a sub. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl1/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/