http://qs321.pair.com?node_id=314393


in reply to Re: Re: Sorting a subset
in thread Sorting a subset

It's a minor point, but as you know every string going into the sort starts with 'A', it is redundant, and much slower, to use substr within the sort block to exclude it.

return sort grep{ substr( $_ , 0, 1 ) eq 'A' } @array;

Will produce the same result more quickly.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!