in reply to Re: Bi-Directional Hash Lookup
in thread Bi-Directional Hash Lookup
use Data::Dumper; my %hash=(foo => 'bar', bar => 'baz'); %hash=(%hash, reverse %hash); print Dumper \%hash;
Incidentally I wouldn't have used your smart and elegant syntax -of which I may have thought, but but which didn't occur to me- and I would have done a clumsier
instead.@hash{values %hash} = keys %hash;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Bi-Directional Hash Lookup
by thor (Priest) on Oct 11, 2005 at 14:48 UTC |