Here is a shot using map:

my @UnSorted = ();
$UnSorted[0] = '-rw------- 1 lward   mail    0 May 24  15:43 lward';
$UnSorted[2] = '-rw------- 1 ohara   mail 8303 May 24  15:42 ohara';  
$UnSorted[1] = '-rw------- 1 dray    mail    0 May 24  15:42 dray'; 

foreach $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 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   mail    0 May 24  15:43 lward
-rw------- 1 ohara   mail 8303 May 24  15:42 ohara   
-rw------- 1 dray    mail    0 May 24  15:42 dray  

Any Suggestions would be greatly appreciated. TIA





=====
Regards,

Gustho

_______________________________________________________
Do You Yahoo!?
Get your free @yahoo.ca address at http://mail.yahoo.ca

Reply via email to