in reply to Numeric Sort for Stringified Value (How to Avoid Warning)
Instead of turning off the warning, you could sort your data using the Schwartzian Transform.
my @new = map { $_->[0] } sort { $b->[1] <=> $a->[1] } map { [ $_, (split( /\s+/, $_, 2 ))[0] ] } @old;
The example assumes all of your data is in the same format as it is given in your post (a number separated from the rest of the string by whitespace).
HTH
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Numeric Sort for Stringified Value (How to Avoid Warning) (Use the ST)
by pg (Canon) on Sep 16, 2005 at 05:32 UTC | |
by bobf (Monsignor) on Sep 16, 2005 at 07:08 UTC | |
by ikegami (Patriarch) on Sep 16, 2005 at 07:10 UTC |