in reply to Re: array substr sort ??
in thread array substr sort ??
What this does is first create a list of arrays, each array contains two elements, the first one is your munged data (lc,substr), and the second element is the actual data. Then you call sort and tell it to compare just the first element, that is, your munged data, then you map again to retreive just the second elements, your actual data.@array = map { $_->[1] } sort { $a->[0] cmp $b->[0] } map { [lc substr($_,18),$_] } @array;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: array substr sort ??
by japhy (Canon) on Nov 07, 2003 at 22:09 UTC |