develooper Front page | perl.beginners | Postings from April 2010

When to use anonymous references

Thread Next
From:
Tim Bowden
Date:
April 26, 2010 07:16
Subject:
When to use anonymous references
Message ID:
1272291387.4599.5.camel@fangorn
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?

Regards,
Tim Bowden


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About