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

Re: use v5.36; use warnings;

Thread Previous | Thread Next
Paul "LeoNerd" Evans
June 18, 2021 21:25
Re: use v5.36; use warnings;
Message ID:
On Fri, 18 Jun 2021 15:24:41 -0400
"Ricardo Signes" <> wrote:

> I think we should declare that "use vX" does this:
>  * use feature ":default"; use feature ":X";
>  * use xyz; (for various xyz);
> That means it would unconditionally turn on strict.  If we add
> warnings, it will unconditionally turn on warnings.

That all sounds quite good, yes.

It's also a much simpler mental model for everyone - each declaration
might fiddle with things, but they all do so in written order.
`use VERSION` might twiddle a lot of things that a later more specific
`no strict 'this'; no warnings 'that';` turns off again.

It also suggests a good general rule - put the `use VERSION` first
thing in the file, then the other use/no pragmata after it.

That's what I in fact already do. :)

Paul "LeoNerd" Evans      |  |

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