in reply to Sorting a subset
If you want to sort asciibeticly just use sort. You don't need to do the substr since the first letter will be 'A' already.for my $ref (sort {substr($a,1) <=> substr($b,1)} grep {substr($_,0,1) + eq 'A'} @array) { #whatever with $ref }
A substr will be faster than doing a regex but if you want to make it short you could also write it like this.for my $ref (sort grep {substr($_,0,1) eq 'A'} @array) { #whatever with $ref }
for my $ref (sort grep /^A/, @array) { #whatever with $ref }
--
flounder
|
|---|