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

Re: [perl #126715] Deprecate barewords?

Thread Previous | Thread Next
November 23, 2015 20:31
Re: [perl #126715] Deprecate barewords?
Message ID:
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'


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