in reply to Re: To Hash or Not to Hash??
in thread To Hash or Not to Hash??
As a quick side note, an idiom for inverting a hash like that is
%ours = reverse %ours;
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.
|
|---|