develooper Front page | perl.perl5.porters | Postings from February 2022

Re: The explicit strict hints bits - Can we remove them?

Thread Previous
From:
Tom Molesworth via perl5-porters
Date:
February 4, 2022 01:25
Subject:
Re: The explicit strict hints bits - Can we remove them?
Message ID:
CAGXhHdk0c7f7Sz2fTkFwMS5tkCu3bYWSRM0Gc1-AwQXbH-Mebg@mail.gmail.com
On Fri, 4 Feb 2022 at 08:21, Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
wrote:

> On Fri, 4 Feb 2022 07:36:21 +0800
> Tom Molesworth via perl5-porters <perl5-porters@perl.org> wrote:
>
> > The concept seems reasonable, just not too clear on exactly what's
> > being suggested - would this affect these two cases, for example?
> >
> > { # Only using some of the features, e.g. variables should be
> > declared, but keep barewords and symbolic references enabled
> >  use strict 'vars';
> >  our $x = example; # should be fine
> >  $y = 'compile-time error'; # should fail
> > }
> >
> > and
> >
> > use strict;
> > { # limited-scope disabling of a feature
> >  no strict 'refs';
> >  our $typo;
> >  my $name = 'whatever';
> >  *$name = sub { # this part is fine
> >   ++$tpyo # would want a compile-time error here
> >  };
> > }
>
> Those two examples would be exactly as they are, entirely unaffected.
>

+1, thanks for the explanation.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About