>I would like to sort the same using
> the last field (ie. lward, ohara, dray) starting with
> the 2nd character (ie from ward , hara and ray) :
Check out perldoc sort and perldoc substr. I think this will do what you
want
@sorted = sort {
$aname = (split /\s+/, $a)[-1];
$bname
$alt (sort {$a->[1] cmp $b->[1] } map{ [$_, /\s+\w(\w+)$/i ] }
@UnSorted) {
printf "%-s\n", $alt->[0];
}
Wags ;)
-Original Message-
From: Gustho [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 15:00
To: [EMAIL PROTECTED]
Subject: Unusual Sort question
Below is
On May 24, Jeff Pinyan said:
>Now the GRT looks like:
>
> @sorted =
>
># get rid of leading sorting string
>map { s/^\S+\s+// }
That should be
map { s/^\S+\s+//; $_ }
or even
grep { s/^\S+\s+// }
You can use grep() here since all lines will match that regex.
--
Jeff "jap
At 05:59 PM 5/24/01 -0400, Gustho wrote:
>Below is a sample directory listing of the mail folder
>on a Linux box, I would like to sort the same using
>the last field (ie. lward, ohara, dray) starting with
>the 2nd character (ie from ward , hara and ray) :
>
>-rw--- 1 lward mail0 May 24
On May 24, Gustho said:
>Below is a sample directory listing of the mail folder
>on a Linux box, I would like to sort the same using
>the last field (ie. lward, ohara, dray) starting with
>the 2nd character (ie from ward , hara and ray) :
>
>-rw--- 1 lward mail0 May 24 15:43 lward
>-rw
Below is a sample directory listing of the mail folder
on a Linux box, I would like to sort the same using
the last field (ie. lward, ohara, dray) starting with
the 2nd character (ie from ward , hara and ray) :
-rw--- 1 lward mail0 May 24 15:43 lward
-rw--- 1 ohara mail 8303 May