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

Re: use v5.36; use warnings;

Thread Previous | Thread Next
Martijn Lievaart
June 21, 2021 18:37
Re: use v5.36; use warnings;
Message ID:
Op 29-05-2021 om 04:29 schreef Darren Duncan:
> 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

This seems like a good way out of this conundrum. It solves all problems.


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