More on Perl Golf (was $10K deathmatch)

Jacob Fugal lukfugl at gmail.com
Thu Nov 2 11:31:48 MST 2006


On 11/2/06, Alan Young <alansyoungiii at gmail.com> wrote:
> perl -ape
> '$_="match\n";$i=1;while($i<@F){((abs($F[$i]-$F[$i-1])||@F)>=@F)&&($_="not
> a $_")&&($i=@F);$i++}'

perl -ape '$_="match\n";$i=0;while(++$i<@F){((abs($F[$i]-$F[$i-1])||@F)>=@F)&&($_="not
a $_")&&last}'

I was tempted to take out the $i=0 (since ++undef is 1, right? :), but
it needs to be there to reset $i for each line, since it remembers its
value. Oh well.

Jacob Fugal



More information about the PLUG mailing list