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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Sorting a subset
by Not_a_Number (Prior) on Dec 12, 2003 at 20:04 UTC | |
by BrowserUk (Patriarch) on Dec 12, 2003 at 20:13 UTC |