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

[perl #3269] no warnings "foo" without "use warnings" turns off all warnings.

Thread Next
From:
Michael G Schwern via RT
Date:
July 12, 2005 20:54
Subject:
[perl #3269] no warnings "foo" without "use warnings" turns off all warnings.
Message ID:
rt-3.0.11-3269-117145.5.73106791006126@perl.org
> [abigail@arenanetworks.com - Fri May 19 04:23:23 2000]:
> 
>     $ perl -wle 'foo.bar'
>     Unquoted string "foo" may clash with future reserved word at -e
> line 1.
>     Unquoted string "bar" may clash with future reserved word at -e
> line 1.
>     Useless use of concatenation (.) in void context at -e line 1.
>     $ perl -wle 'no warnings "bareword"; foo.bar'
>     $

It seems that 'no warnings "foo"' without a preceding "use warnings"
turns off all warnings even if -w is given!


> The latter should warn about the void use of concatenation.
> 
>     $ perl -wle 'use warnings "all"; no warnings "bareword"; foo.bar'
>     Unquoted string "foo" may clash with future reserved word at -e
> line 1.
>     Unquoted string "bar" may clash with future reserved word at -e
> line 1.
>     Useless use of concatenation (.) in void context at -e line 1.
>     $
> 
> And this should have warned only about the void use of concatenation.

No, "Unquoted string..." is a "reserved" warning.


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