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

Re: The Santa Claus Golf Apocalypse

Thread Previous | Thread Next
From:
Jeff 'japhy' Pinyan
Date:
December 3, 2001 15:43
Subject:
Re: The Santa Claus Golf Apocalypse
Message ID:
Pine.GSO.4.21.0112031840180.5335-100000@crusoe.crusoe.net
On Dec 3, Piers Cawley said:

>Eugene van der Pijll <E.C.vanderPijll@phys.uu.nl> writes:
>
>> Piers Cawley schreef op 03 december 2001:
>>> Eugene van der Pijll <E.C.vanderPijll@phys.uu.nl> 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

becomes

  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      japhy@pobox.com      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About