I have this piece of script :
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my @arr = (
{
name => 'foo',
value => 123,
},
{
name => 'bar',
value => 'nan',
},
{
name => 'foobar',
value => 456,
},
);
@arr = sort {$a->{value} <=> $b->{value} } @arr;
print Dumper(\@arr);
I don't have any problems under Windows XP / Strawberry Perl 5.10.1
either Linux 2.6.12-1 i386 / Perl v5.8.5 built for i386-linux-thread-multi,
but under Linux 2.6.18-53 / Perl v5.8.8 built for x86_64-linux-thread-multi, i got the error message :
Sort subroutine didn't return a numeric value at testsort.pl line 21.
What's going wrong and how can i fix it ?