develooper Front page | perl.fwp | Postings from December 2001

Re: The Santa Claus Golf Apocalypse

Thread Previous | Thread Next
Jeff 'japhy' Pinyan
December 3, 2001 15:43
Re: The Santa Claus Golf Apocalypse
Message ID:
On Dec 3, Piers Cawley said:

>Eugene van der Pijll <> writes:
>> Piers Cawley schreef op 03 december 2001:
>>> Eugene van der Pijll <> writes:
>>> >
>>> > Of course, using what I assume to be the same hack, my score goes
>>> > down
>>> > by two strokes as well...
>>> Only two? You can get it down by three.
>> You're right, after some experimenting, I found the 1-character exit.
>> How very... interesting... if that is the right word.
>Don't you just love the error message? I have the feeling that it
>might be a bug because it gives a syntax error in another context.

It is not a bug.

  perl -peCODE


  while(<>){CODE;}continue{print or die qq(-p destination: $!\n);}

(I kept the non-important parts simple.)

That means I can write

  echo "hah" | perl -lpe 'print q'

and get

  }continue{print or die qq(-p destination: $!\n)

Jeff "japhy" Pinyan
RPI Acacia brother #734
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About