Hello Monks,
I am sorting a hash by value like so:
foreach my $tc (sort {$passes->{$a}->{'cpu'} <=> $passes->{$b}->{'cpu'}} keys %{$passes}) {
Some of the values are "-", so I get this error:
Argument "-" isn't numeric in numeric comparison (<=>) at /home/fisusr/bin/rdi_report_wrapper.pl line 183
How can I avoid this error?
Thanks,
Rachel
In reply to Numeric Sorting on Characters by halecommarachel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |