in reply to Question about fast switch hash key-value pairs.
Your code is fine.
Another way is to use a hash slice, using values to get the keys and keys to get the values.
Yet another way is to assign one hash to the other while using reverse.
All of these methods assumes the values are unique.
Update: Added last solution.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Question about fast switch hash key-value pairs.
by Erez (Priest) on Apr 03, 2008 at 06:46 UTC |