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

Re: use v5.36; use warnings;

Thread Previous | Thread Next
From:
Neil Bowers
Date:
June 6, 2021 23:09
Subject:
Re: use v5.36; use warnings;
Message ID:
afdc9758-f617-4632-b423-e8e16bfae450@Spark
> In other words, "use vX" turns on strict if X is at least 5.12.0, unless it was preceded by "no strict".

TIL ...

Some questions / observations:

1. What happens if "use vX" is preceded by "no strict 'refs'" – do you get strict vars and subs?
2. Is this documented anywhere (other than the perldelta that introduced it, which was presumably 5.12?
3. Seems like this should be mentioned in the doc for strict (that was the first place I looked)
4. If the answer to #1 is "Yes", then the doc for `use` should probably be updated too.

This behaviour seems surprising.

I like Darren’s suggestion, that "no warnings" before "use v5.36" should warn, but give 5.36’s warnings behaviour.

Which means that I think that "no strict" before "use vN" should warn and give "use vN"’s behaviour. But if we change that, there should be 2 releases where you get the warning but the current behaviour, and then we flip.

Neil

	
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