lihao has asked for the wisdom of the Perl Monks concerning the following question:
Hi, monks
Without loading any Perl modules, what is the fastest or best way to change key=>value pairs to value=>key pairs of a large hash. Assume no duplication in both key and value fields.. Many thanks
BTW. I am now using the following which looks dummy
$hash1{$hash2{$_}} = $_ for keys %hash2;
lihao
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question about fast switch hash key-value pairs.
by ikegami (Patriarch) on Apr 02, 2008 at 22:48 UTC | |
by Erez (Priest) on Apr 03, 2008 at 06:46 UTC | |
|
Re: Question about fast switch hash key-value pairs.
by FunkyMonk (Bishop) on Apr 02, 2008 at 21:32 UTC |