develooper Front page | perl.perl5.porters | Postings from November 2015

Re: [perl #126715] Deprecate barewords?

Thread Previous | Thread Next
From:
Abigail
Date:
November 23, 2015 20:31
Subject:
Re: [perl #126715] Deprecate barewords?
Message ID:
20151123203136.GB5188@almanda.fritz.box
On Mon, Nov 23, 2015 at 12:00:53PM -0800, Chad Granum wrote:
> I can think of one place where people may be accidentally using this, and
> that is in import arguments to packages that also turn on 'strict' and
> 'warnings' for you.
> 
> use Foo xxx, yyy, -foo;
> 
> If you use strict and warnings before that then it will fail. However if
> that turns on strict and warnings like Moose and many other packages these
> days then it will work fine, and do what you expect (stringify the
> barewords).
> 
> I am not making a judgement call on weather people SHOULD or SHOULD NOT do
> this. However I have seen it done, and discovered it when I realized I had
> accidentally been doing it in a few places.


Here's another accidental way:


    $ perl -le '$x = 'foo'; print $x'


Abigail

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