Re: Phalanx top 100 CPAN modules golf

Andrew Savige <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
Rick Klement wrote:
> And replacing one map with a sort, taking advantage of the fact that
> in 5.8, sort is stable, saves 10 strokes:

#!perl -lp
/ /;$a{pack A10,$'}.=" $`"}for(sort{$b-$a}map$a{$_}=~y/ //.
" $_:$a{$_}",sort keys a){

Very nice.  Hmm, if:
  "map sort [SORT BLOCK]    map" is the Schwartzian Transform; and
  "map sort [NO SORT BLOCK] map" is the Guttman-Rosler Transform
does that make:
  "sort [SORT BLOCK] map sort"   the Klement Transform?
Or should that read Klementian or even Klementine Transform? :-)

> P.S. Ever wonder what yours is going to do when someone has more
> than nine modules ?

Argument "-" isn't numeric in subtraction (-) at a.pl line 2 ...
I suppose I could change 9 to 99 and 's/./' to 's/../'.

/-\


http://search.yahoo.com.au - Yahoo! Search
- Looking for more? Try the new Yahoo! Search
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.