in reply to Numeric Sorting on Characters
sub by_cpu { no warnings 'numeric'; $passes->{$a}{cpu} <=> $passes->{$b}{cpu}; } for my $tc (sort by_cpu keys %$passes) { # ...
my @dashed; my @sorted = sort { $passes->{$a}{cpu} <=> $passes->{$b}{cpu} } grep { '-' ne $passes->{$_}{cpu} or push @dashed, $_ and 0 } keys %$passes; for my $tc (@dashed, @sorted) { # ...
Update: Ouch. no cannot go to the sort code. Changed option 2 and added option 3.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Numeric Sorting on Characters
by halecommarachel (Sexton) on Aug 15, 2013 at 00:08 UTC | |
by choroba (Cardinal) on Aug 15, 2013 at 00:13 UTC |