Jeff Pang wrote:
-----Original Message-----
From: "Mr. Shawn H. Corey" <[EMAIL PROTECTED]>
Sent: Aug 21, 2007 12:32 PM
To: Jeff Pang <[EMAIL PROTECTED]>
Cc: beginners@perl.org
Subject: Re: regex help
Jeff Pang wrote:
my @new = map { $_->[0] } sort { $b->[1] <=> $a->[1] } map {
[$_,(split/-/)[-1]] } @arr;
print "@new[0..4]";
Fails; this would put '15-special.3-45' before '15-special.1-51'
Well,have you tested the codes then said this?
I sort it based on the last number field splited by '-'.It works fine for me.
The point is that only the OP can say what is significant. And s/he hasn't.
--
Just my 0.00000002 million dollars worth,
Shawn
"For the things we have to learn before we can do them, we learn by doing them."
Aristotle
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/