$10K coding deathmatch

Steve smorrey at gmail.com
Thu Nov 2 08:30:03 MST 2006


Why does perl code always remind me of explitives?

On 11/2/06, Alan Young <alansyoungiii at gmail.com> wrote:
> Paul Seamons wrote:
> > PS - unmaintainable solution in perl
> > perl -ne 'chop;@a=split;$n=grep{$t=abs($a[$_]-$a[$_-1]);!$t||$t>=@a}1..
> > $#a;print$n?"not a ":"","match\n"'
>
> I wasn't going to do this but you got me thinking:
>
> perl -ape '$_=((grep{(abs($F[$_]-$F[$_-1])||@F+1)>@F}1..$#F)?"not a
> ":"")."match\n"'
>
> Am I missing something obvious (or even not so obvious)?
>
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */
>



More information about the PLUG mailing list