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

Re: use v5.36; use warnings;

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
June 18, 2021 21:25
Subject:
Re: use v5.36; use warnings;
Message ID:
20210618222453.01fba25f@shy.leonerd.org.uk
On Fri, 18 Jun 2021 15:24:41 -0400
"Ricardo Signes" <perl.p5p@rjbs.manxome.org> 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

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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