Given that delete can delete a slice, this can be simplified:
my %map = (...); @$h{values %map} = delete @$h{keys %map};
Update: note that this doesn't break on %map = (foo => 'bar', bar => 'foo') that the solutions above may do.
lodin
In reply to Re^3: can i rename hashref keys?
by lodin
in thread can i rename hashref keys?
by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |