Perl-Sensitive Sunglasses | |
PerlMonks |
Re: What defines the choice of a Hash or an Array?by thinker (Parson) |
on Mar 31, 2005 at 08:32 UTC ( [id://443731]=note: print w/replies, xml ) | Need Help?? |
Hi ghenry, When I am thinking of my code, there are two words which I look out for which suggest I might want ot use a hash. Those words are "of" and "contains" (or its more perlish alternative, exists). An example of "of" might be
The fast access speed of hashes makes it a good candidate to find the intersection of two lists. For (a rather contrived) example
Hope this helps thinker
In Section
Seekers of Perl Wisdom
|
|