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

Re: use v5.36; use warnings;

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
May 29, 2021 14:12
Subject:
Re: use v5.36; use warnings;
Message ID:
eaf3d1ff-94a0-4abd-a437-2b7868ca573b@beta.fastmail.com
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"?

-- 
rjbs
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