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

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

Thread Next
From:
Tony Cook via RT
Date:
February 1, 2017 05:34
Subject:
[perl #130674] lib/vars.pm setting $^H?
Message ID:
rt-4.0.24-29429-1485927238-1987.130674-15-0@perl.org
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.

Tony

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

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