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

Re: use v5.36; use warnings;

Thread Previous | Thread Next
From:
Darren Duncan
Date:
May 29, 2021 02:29
Subject:
Re: use v5.36; use warnings;
Message ID:
dea0a124-35e5-96cd-6b99-492de53de4a7@darrenduncan.net
On 2021-05-28 7:12 p.m., Ricardo Signes wrote:
> On Fri, May 28, 2021, at 9:29 PM, Darren Duncan wrote:
>> What I would expect to happen is that the statements are applied in order.  So a
>> "no warnings" above the "use" would have no effect, turning warnings off before
>> they're turned on again, but having it following the "use" would turn warnings
>> off after they're turned on. -- Darren Duncan
> 
> Except that's not how this works with strict, so the question is where we choose 
> to be consistent.

Here's an idea.  If a file contains "use 5.36" or higher, and it contains either 
"no warnings" or "no strict" above that use line, then a warning will be emitted 
that the "no" should be below the "use" rather than above it.  This only happens 
for programs with "use 5.36" so older programs won't get extra warnings.  The 
warnings only appear when someone makes the explicit change to add the "5.36" 
and then it will say okay you just made that change now make this change.  Also 
the use warnings behavior will be dependent on order rather than not like use 
strict. -- Darren Duncan

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