in reply to Sorting complex records
If, as appears likely, the first field is an ID number (ie always the two letters 'ID' followed by a number), it would be nice to sort these numerically rather than ascibeticallly (ie with ID100 coming after rather than before ID20...).
Adapting the first answer given above, you could do this:
@data = sort { substr ($a->[0], 2) <=> substr ($b->[0], 2) || $a->[3] <=> $b->[3] } @data;
Meanwhile, I've downloaded the Data::Sorting module and have started playing with it, but haven't yet worked out how this would be done (although I'm sure it's simple :-).
dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Sorting complex records
by simonm (Vicar) on Sep 17, 2003 at 22:09 UTC |