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:
Rafael Garcia-Suarez
Date:
July 30, 2009 14:23
Subject:
Re: "Keyword" labels now forbidden (was [perl.git] branch blead, updated. GitLive-blead-1705-gf71d615)
Message ID:
b77c1dce0907301422vb6a1178p79efaa30677dbe65@mail.gmail.com
2009/7/30 Chip Salzenberg <chip@pobox.com>:
> On Thu, Jul 30, 2009 at 07:57:48PM +0100, Nicholas Clark wrote:
>> On Thu, Jul 30, 2009 at 11:53:37AM -0700, David E. Wheeler wrote:
>> > On Jul 30, 2009, at 10:27 AM, Chip Salzenberg wrote:
>> >
>> > >First, how about if we disallow only the BEGIN-family of keywords as
>> > >labels?
>> > >Considering the original bug report those are the ones that can cause
>> > >trouble.  Writing "for: {}" is weird but why should we stop you,
>> > >really?
>> >
>> > I think just disallowing the uppercase keywords would be sufficient.
>>
>> Except that the problem is the keywords that are functions:
>>
>> $ perl -e 'print: goto print'
>> Can't find label 1 at -e line 1.
>
> Darn.  Looks like the already-committed complete ban on keyword labels is
> the sanest option.  Fortunately we do have C<use VERSION> to limit any
> collateral damage from new keywords.

Yes, that's what seemed to me too.

I've now checked in an error message improvement as suggested by Jerry.

$ bleadperl -Esay:
Can't use keyword 'say' as a label at -e line 1.

You will note that "bleadperl -esay:" doesn't produce an error. Only
current keywords are checked.

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