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};
In reply to Re^2: how can i replace a hash key with other hash value?
by JavaFan
in thread how can i replace a hash key with other hash value?
by satzbu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |