in reply to Debugging a sort in PDL routine
You may need to re-evaluate where your error is coming from.. this runs fine on perl 5.8
my %hash = ( key1 => 1, key2 => 2, key3 => 3, empty => undef, string => 'blah', string2 => '4', ); my @sorted = sort {$hash{$a} <=> $hash{$b}} keys %hash; print "\nSorted:\n"; foreach(@sorted){ print "$_\n"; } __END__ prints: Sorted: string empty key1 key2 key3 string2
cheers,
J
|
|---|