develooper Front page | perl.perl5.porters | Postings from May 2021

Re: use v5.36; use warnings;

Thread Previous | Thread Next
Ricardo Signes
May 29, 2021 14:12
Re: use v5.36; use warnings;
Message ID:
On Fri, May 28, 2021, at 10:49 PM, L A Walsh wrote:
> Before commenting on anything else, I hope the above is clarified...

I'm afraid I had a really hard time understanding your post, so I'm going to try the old strategy of stating all the facts that might be relevant.

1️⃣ strict is not on by default in any version of perl5 and this is not changing.

Example code:

perl -e '$x = 1'

2️⃣ since perl v5.12.0, "use v5.12.0" has enabled strict, *unless it was explicitly disabled first*

Example code:

perl -e 'use v5.12.0; $x = 1'

perl -e 'no strict; use v5.12.0; $x = 1'

In other words, "use vX" turns on strict if X is at least 5.12.0, unless it was preceded by "no strict".

3️⃣ I am proposing that putting "use v5.36.0" (or later) in your program will *also* enable warnings

…and then the question is: will "use v5.36.0" have the same quirk of not turning on warnings if it was preceded by "no warnings"?

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