in reply to Getting the keys of identical values in a hash
I also think a while/each might be nice here, as it makes the inversion of the hash a bit clearer:my %ih; $ih{$hash{$_}}{$_}++ for keys %hash; print for grep { keys %{$ih{$_}} > 1 } keys %ih;
while ( my($key,$val) = each %hash ) { $ih{$val}{$key}++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting the keys of identical values in a hash
by knsridhar (Scribe) on Sep 15, 2005 at 09:08 UTC |