Re: What does }{ mean?

2004-02-07 Thread Leo
On Fri, Feb 06, 2004 at 09:46:50PM +, Ton Hospel scripsit: See also: echo | perl -lpe 'print q' which outputs: }continue{print or die qq(-p destination: $!\n) Well, I had no problem with the thread until now! How the f... does this work Golfers also use the fact that in a

RE: What does }{ mean?

2004-02-07 Thread Jonathan Weed
What does the construct }{ mean? From perlrun: -p causes Perl to assume the following loop around your program, which makes it iterate over filename arguments somewhat like sed: LINE: while () { ...# your program goes here } continue { print or die -p destination: $!\n; } The

Re: What does }{ mean?

2004-02-07 Thread Matthew Byng-Maddick
On Fri, Feb 06, 2004 at 11:56:16PM +0100, Leo wrote: On Fri, Feb 06, 2004 at 09:46:50PM +, Ton Hospel scripsit: See also: echo | perl -lpe 'print q' which outputs: }continue{print or die qq(-p destination: $!\n) Well, I had no problem with the thread until now! How the f... does

Re: What does }{ mean?

2004-02-07 Thread Peter Makholm
Leo [EMAIL PROTECTED] writes: echo | perl -lpe 'print q' which outputs: }continue{print or die qq(-p destination: $!\n) Well, I had no problem with the thread until now! How the f... does this work It gets converted to: LINE: while (defined($_ = ARGV)) { print

Re: What does }{ mean?

2004-02-06 Thread Daniel R. Allen
I am appalled that that works. I thought perlrun was being figurative when it described -p, but it seems not so. [EMAIL PROTECTED]:~/work$ perl -MO=Deparse -pe ' } { $_=foo\n' /dev/null LINE: while (defined($_ = ARGV)) { (); } { $_ = foo\n; } continue { print $_;

Re: What does }{ mean?

2004-02-06 Thread Ian Phillipps
On Fri, 06 Feb 2004 at 09:45:43 -0500, [EMAIL PROTECTED] wrote: What does the construct }{ mean? As in $ perl -pe ' } { $_=foo\n' /dev/null foo I figure it has to do with how the -p switch affects the script that is passed to the interpreter. Is this documented anywhere? Yes, in

Re: What does }{ mean?

2004-02-06 Thread kynn
X-Original-To: [EMAIL PROTECTED] Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm From: Allen, Greg [EMAIL PROTECTED] Date: Fri, 6 Feb 2004 14:51:57 - X-WSS-ID: 6C3D75871563186-01-01 X-BigFish: v X-SMTPD: qpsmtpd/0.26, http://develooper.com/code/qpsmtpd/ It is

RE: What does }{ mean?

2004-02-06 Thread Allen, Greg
, 2004 3:37 PM To: Allen, Greg Cc: [EMAIL PROTECTED] Subject: Re: What does }{ mean? X-Original-To: [EMAIL PROTECTED] Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm From: Allen, Greg [EMAIL PROTECTED] Date: Fri, 6 Feb 2004 14:51:57 - X-WSS-ID: 6C3D75871563186-01-01 X

Re: What does }{ mean?

2004-02-06 Thread kynn
From: Allen, Greg [EMAIL PROTECTED] It would appear that any block is allowed a continue clause. That's what threw me off. kj

Re: What does }{ mean?

2004-02-06 Thread Uri Guttman
K == [EMAIL PROTECTED] writes: K I figured that much, but then I'm left with interpreting a construct K of the form: Kwhile(defined($_ = ARGV)){}{$_ = foo\n}continue{print $_} K ^^ K ?? K I didn't think such a

Re: What does }{ mean?

2004-02-06 Thread Ton Hospel
See also: echo | perl -lpe 'print q' which outputs: }continue{print or die qq(-p destination: $!\n) Golfers also use the fact that in a -p/-n program the next character is a ;, for example #!perl -alp0 s!.+!$;[EMAIL PROTECTED],$_}=%$z]=$z=$_.$[EMAIL PROTECTED],@F!eg;$_=pop@ as solution to