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

Re: use v5.36; use warnings;

Thread Previous | Thread Next
Darren Duncan
May 30, 2021 00:43
Re: use v5.36; use warnings;
Message ID:
On 2021-05-29 7:11 a.m., Ricardo Signes wrote:
> 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"?

To answer your question, I am proposing that the behaviour of "no strict" prior 
to the "use" is a mistake not to be repeated, and that reasonable actions are 
taken to mitigate that mistake.

So "no warnings" will NOT behave the same as "no strict", and rather "no 
warnings" will only have an effect if it FOLLOWS something that turns warnings on.

As for the inconsistency this would raise with "no strict", I propose the 
solution is simply to emit a warning in any program that has a "no strict" prior 
to a "use 5.36" and the warning would say the statements should be reordered so 
the "no strict" appears afterwards.

That solution means actual programs are consistent in appearance and behavior. 
While "no strict" would still suppress strict if used first, anyone attempting 
to use it would be warned to stop doing so, and so that behavior becomes unused.

-- Darren Duncan

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