in reply to Re: re-key a hash
in thread re-key a hash
Much better :)
{ local $_ = keys( %h ) -1; @h{ 0 .. $_ } = delete @h{ sort { $a<=>$b } keys %h }; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: re-key a hash
by Aristotle (Chancellor) on Aug 03, 2004 at 02:35 UTC |