On Thursday 15 July 2004 13:54, Jeff Westman wrote:
>
> Hi,

Hello,

> I need to do a sort on a couple of column ranges.
>
> I want to be able to do a primary sort, on say, columns 21-25 and
> then a secondary sort on columns 40-49.
>
> Any ideas on how to approach this?

This should work:

my @sorted = map substr( $_, 15 ),
             sort
             map substr( $_, 20, 5 ) . substr( $_, 39, 10 ) . $_,
             @unsorted;


John
-- 
use Perl;
program
fulfillment


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to