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

Re: use v5.36; use warnings;

Thread Previous | Thread Next
Neil Bowers
June 6, 2021 23:09
Re: use v5.36; use warnings;
Message ID:
> 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.


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