Much better :)
{ local $_ = keys( %h ) -1; @h{ 0 .. $_ } = delete @h{ sort { $a<=>$b } keys %h }; } [download]
In reply to Re^2: re-key a hash by BrowserUk in thread re-key a hash by Anonymous Monk