develooper Front page | perl.perl5.porters | Postings from September 2018

[perl #130674] lib/vars.pm setting $^H?

From:
Tony Cook via RT
Date:
September 26, 2018 05:12
Subject:
[perl #130674] lib/vars.pm setting $^H?
Message ID:
rt-4.0.24-18817-1537938765-750.130674-15-0@perl.org
On Tue, 31 Jan 2017 21:33:58 -0800, tonyc wrote:
> On Mon, 30 Jan 2017 09:45:53 -0800, hv wrote:
> > I just noticed this in lib/vars.pm:
> >     } elsif  (($^H &= strict::bits('vars'))) {
> >                    ^^
> > which seems a bit weird. The check was introduced in 2000 by
> > 1d76c68a,
> > and
> > survived numerous further edits in 2002, but hasn't been touched
> > since
> > then.
> >
> > I suspect it should just be:
> >   } elsif ($^H & strict::bits('vars')) {
> > but I'm not sure; if it is correct, it'd be useful to add a comment
> > explaining why it's sane.
> 
> It's broken, since it removes non-vars strictness:
> 
> ./perl -Ilib -e 'use strict "refs"; use vars qw($foo$); my $x= "abc";
> print $$x'
> 
> (no error from the symbolic ref)
> 
> The attached fixes it, but we're in a "no changes in behaviour"
> freeze.  This has been broken long enough that I could easily see code
> out there this fix would break.

Applied as eda3f954e1ab1728381b70aa008fe2226fd05de2 with some minor changes.

Tony



---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=130674



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