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

Re: [FWP] 4 Consecutive Letters



On Mon, Aug 14, 2000 at 11:58:26PM -0400, Uri Guttman wrote:
> >>>>> "PS" == Peter Scott <Peter@PSDT.com> writes:
> 
>   PS> At 10:10 PM 8/14/00 -0400, Rick Delaney wrote:
>   >> Don't forget the common golf trick of replacing ($1) with $&,
>   >> 
>   >> perl -ne'/.(??{++($b=++($a=$&));$a.$b.++$b})/&&print'
>   >> 
>   >> though I can't say that that's properly defined, either.
> 
>   PS> That makes this the shortest so far, then:
> 
>   PS>        perl -ne'/.(??{($a=$&)++;$a++.$a++.$a})/&&print'
> 
> and i bet you can change && to & for one more char (another golf trick
> that works sometimes).

I don't think so, as && short circuits and & doesn't, and the short
circuiting behaviour is essential.

>                        i can't test as /usr/dict/words on solaris
> doesn't seem to have any words that match that.

    cp /usr/dict/words /tmp/words; echo "fooabcd" >> /tmp/words


Abigail

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