Just make a change to the sort line:
@sortdata = sort { $a cmp $b } @data;
The thing is, the <=> operator is for numeric comparisons, and the cmp operator is for string comparisons. See perlop for details on those operators.
Dave
In reply to Re: Sorting data problem
by davido
in thread Sorting data problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |