Yes, but it requires a temporary scalar.
my $n = keys( %hash ) -1; @hash{ 0 .. $n } = delete @hash{ sort { $a<=>$b } keys %hash };
In reply to Re: re-key a hash
by BrowserUk
in thread re-key a hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |