>>>>> "+Brian" == +Brian d foy <[EMAIL PROTECTED]> writes:
+Brian> my @sorted = map { $_->[0] }
+Brian> sort { $a->[1] cmp $b->[1] }
+Brian> map { [ $_, substr($_, 2, 3) ] }
+Brian> @lines;
Except that the substr() function is likely not expensive enough to
outweigh all those arrayrefs being created and destroyed.
Thus, also try:
my @sorted = sort { substr($a, 2, 3) cmp substr($b, 2, 3) } @lines;
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]