Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
@hash = ("name" =>"john", "age"=>"25", "job"=>"programer", "location" +=>"US"); %test = @hash; %test_1 = (); foreach $key (keys %test) { $val = $test{$key}; $test_1{$val} = $key; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: key-values swapped
by thinker (Parson) on Feb 18, 2005 at 09:44 UTC | |
by Anonymous Monk on Feb 18, 2005 at 10:02 UTC | |
by Tanktalus (Canon) on Feb 18, 2005 at 15:43 UTC | |
Re: key-values swapped
by Corion (Patriarch) on Feb 18, 2005 at 09:44 UTC | |
by Anonymous Monk on Feb 18, 2005 at 10:00 UTC | |
Re: key-values swapped
by Fletch (Bishop) on Feb 18, 2005 at 17:42 UTC | |
Re: key-values swapped
by Cody Pendant (Prior) on Feb 19, 2005 at 09:30 UTC | |
Re: key-values swapped
by sh1tn (Priest) on Feb 18, 2005 at 09:48 UTC |