develooper Front page | perl.perl5.porters | Postings from September 2001

Re: do{die} vs. do{ die}

Thread Previous
Barrie Slaymaker
September 21, 2001 05:05
Re: do{die} vs. do{ die}
Message ID:
On Fri, Sep 21, 2001 at 09:30:32AM -0000, Rafael Garcia-Suarez wrote:
> Yes.


> The internal line number maintained by the tokenizer is incremented
> when it skips whitespace.  (Technically, S_incline() is called by
> S_skipspace()). And, if I understand correctly, the line number
> associated to the op corresponding to a statement is set when the parser
> finishes reducing to the rule for this statement : here, when is reduces
> "print" / "do{die}".

Hmmmm, why does

   $ perl -e 'sub c{(caller)[2]}print
   > c,do{c},do{ c},"\n"'

behave in the opposite manner? (fond rememberances of tinkering with an
8 pin TTL SSI timer chip 20 odd years ago....)

> I don't think it's worth fixing.

As long as the spaced-out version always works, then it's not worth a
lot of energy to fix (though if someone can cough up a patch easily, it
is a bug).

> In fact I can't decide whether "line 5" or "line 1" is more correct.

Thanks for the explanation.  How could "line 1" be correct?  The
die() is on the 5th line.

- Barrie

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