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

Re: use v5.36; use warnings;

Thread Previous | Thread Next
From:
L A Walsh
Date:
June 1, 2021 01:23
Subject:
Re: use v5.36; use warnings;
Message ID:
60B58BA1.90004@tlinx.org
On 2021/05/29 07:11, Ricardo Signes wrote:
> 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*
>   

---
This clarifies my misunderstanding.

I've virtually never used:
'use v5.12.0'   #(or any other version) *without*

prior lines (or immediately after):
  use warnings;use strict;

So I wasn't aware that use strict was already toggled on before such.


I find it a bit odd that having the use-version after
the no-strict wouldn't toggle it back on if
'use strict' was advertised being part of the 5.12 bundle.

I'm not sure I understand why that was done that way, since it would
seem to violate normal perl semantics.


I'm assuming that the order:

use v5.12.0;
no strict;

Would also result in 'strict being off'?
Is it also the case that a "use version" statement, for any version 
 >5.12.0, also toggles on strict, but is similarly silenced by a 'no 
strict' on either side of the 'use'?










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