Quote:
Originally Posted by dangral
Thanks. I figured it out.
Code:
sub Bysite {
if ( $a =~ /^0[SV]/ ) {
return -1;
}
elsif ( $b =~ /^0[SV]/ ) {
return 1;
}
lc($a) cmp lc($b);
}
@array = sort Bysite @array;
|
Thats a good solution but it will not sort your sample array into what you posted:
0S09
0S22
0V54
0V72
0A13
0H98
0L43
EL24
STB45
it sorts a little differently:
0S22 <--
0S09 <--
0V54
0V72
0A13
0H98
0L43
EL24
STB45
but maybe close enough is OK
