On Tue, Apr 16, 2002 at 11:05:29AM +1000, [EMAIL PROTECTED] wrote:
> 
> BTW, I was blown away by Ton using the 'x' modifier.
> Never in my wildest dreams could I have imagined that
> this modifier would have been useful in golf!

I used /x in a solution to the 4 Consecutive Letters challenge on FWP in
August 2000:

perl -ne'for$i(97..119){print,last if/@{[map chr,$i..$i+3]}/x}'

(Tim Ayers then reduced this to:

perl -ne'@a=a..z;for$i(0..22){print,last if/@a[$i..$i+3]/x}'

)

The challenge was to find words which contain four consecutive letters as
they appear in the alphabet, i.e. understudy contains rstu.

Ronald

Reply via email to