in reply to Re: how can i replace a hash key with other hash value?
in thread how can i replace a hash key with other hash value?
You can't "replace a key" but you can set a new one and delete the existing oneAnd you can do that in one line:
which has the added benefit to even work correctly when $hash_tr_fr{$eng} eq $eng. Doing the delete in a separate step would result in a loss of the entry.$hash{$hash_tr_fr{$eng}} = delete $hash{$eng};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: how can i replace a hash key with other hash value?
by cdarke (Prior) on Mar 24, 2010 at 10:59 UTC |