here is my problem i have a series of indexes which i would like to sort, but using this code :
the result is : St1 St10 St12 St2 St6 St8 but what i need is :use strict; my @g = qw(St1 St10 St2 St12 St6 St8); my @b = sort{$a cmp $b} @g; foreach my $x (@b){ print "$x\n"; }
St1 St2 St6 St8 St10 St12
i mean i don't know how to sort a set of strings that have numbers in it . i mean i understand why this isn't working by the method i used but if any one has any suggestions on how to overcome this problem ...
thanx
In reply to sorting an array mix by baxy77bax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |