develooper Front page | perl.perl5.porters | Postings from July 2009

Re: "Keyword" labels now forbidden (was [perl.git] branch blead, updated. GitLive-blead-1705-gf71d615)

Thread Previous | Thread Next
From:
David Nicol
Date:
July 30, 2009 00:22
Subject:
Re: "Keyword" labels now forbidden (was [perl.git] branch blead, updated. GitLive-blead-1705-gf71d615)
Message ID:
934f64a20907300022h56767a5arbb7c16627fad6fbd@mail.gmail.com
On Thu, Jul 30, 2009 at 1:19 AM, Rafael
Garcia-Suarez<rgarciasuarez@gmail.com> wrote:
> 2009/7/30 David Nicol <davidnicol@gmail.com>:

>> it's already a synbtax error when it makes no sense.  What's the harm?
>
> No it's not :
>
> $ perl -e 'goto print'
> Can't find label 1 at -e line 1.

$ perl -le '1: $x++ > 3 and die 1; goto print $x'
syntax error at -e line 1, near "1:"
Execution of -e aborted due to compilation errors.

is there a way to create "1" as a label? perldoc perlsyn says labels
"consist of an identifer followed by a colon" but the word
"identifier" does not appear again in that document.

Allowing numeric labels would make Perl more friendly to FORTRAN programmers...

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