Paul Seamons wrote:
> On Thursday 02 November 2006 8:35 am, Alan Young wrote:
>> perl -ape '$_=((grep{(abs($F[$_]-$F[$_-1])||@F)>[EMAIL PROTECTED])?"not a
>> ":"")."match\n"'
>
> Wow! Truly a thing of beauty.
>
> "-a" - who knew.
*blush* Thanks.
My only problem with this method is that it goes through every single
element of @F, even if the first comparison makes the line not match.
Of course, this would be a simple matter in a more maintainable piece of
code, but I've got to wonder if there isn't a Perl Golfish way to short
circuit the grep and do a next...
/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/