in reply to re-key a hash

Yes, but it requires a temporary scalar.

my $n = keys( %hash ) -1; @hash{ 0 .. $n } = delete @hash{ sort { $a<=>$b } keys %hash };

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon