in reply to Sorting data problem
you should have@sortdata = sort { $a <=> $b } (@data);
or even simply@sortdata = sort { $a cmp $b } (@data);
The reason is that <=> compares two values numerically whereas cmp compares them alphabetically. This is the default behavior for sort, though.@sortdata = sort @data;
|
|---|