[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Sort challenge



>>>>> "CRT" == Casey R Tweten <crt@kiski.net> writes:


  CRT> 84 characters:

  CRT>     print sort{lc$a cmp lc$b}
  CRT>     map{/(.*)\|(.*)\|(.*)/;($2?join', ',$2,$3||():$3||$1).$/}<>

           print sort{lc$a cmp lc$b}
           map{/(.*)\|(.*)\|(.*)/;($2?"$2${$3&&\qq{, $3}}":$1).$/}<>

cut off 2 more.

i had thought of using a GRT but it seems the extracting and reordering
is heavier than using a lc sort like the above.

the key here is how to handle $3 in fewer strokes. i feel there is even
a better way to do that.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe