The stupid question is the question not asked | |
PerlMonks |
Re: Re: To Hash or Not to Hash??by gwadej (Chaplain) |
on Dec 02, 2003 at 16:48 UTC ( [id://311685]=note: print w/replies, xml ) | Need Help?? |
As a quick side note, an idiom for inverting a hash like that is
This may not be the right choice if the hash is very large because of the extra memory used by the temporary list. But in this case, it looks like it would be okay. See recipe 5.8 in the Perl Cookbook. Obviously, both of our solutions will have problems if the values are not unique.
G. Wade
In Section
Seekers of Perl Wisdom
|
|