-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/vars.pm setting $^H? #15851
Comments
From @hvdsCreated by @hvdsI just noticed this in lib/vars.pm: I suspect it should just be: Perl Info
|
From @tonycozOn Mon, 30 Jan 2017 09:45:53 -0800, hv wrote:
It's broken, since it removes non-vars strictness: ./perl -Ilib -e 'use strict "refs"; use vars qw( (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 |
From @tonycoz0001-perl-130674-don-t-modify-H.patchFrom 0bba1946d4e5d7551607c413320146b6cc4085a6 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Wed, 1 Feb 2017 16:31:02 +1100
Subject: (perl #130674) don't modify $^H
This could remove non-vars strictness from the caller.
---
lib/vars.pm | 4 ++--
lib/vars.t | 9 ++++++++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/lib/vars.pm b/lib/vars.pm
index 6ca6bb4..fc95c77 100644
--- a/lib/vars.pm
+++ b/lib/vars.pm
@@ -2,7 +2,7 @@ package vars;
use 5.006;
-our $VERSION = '1.03';
+our $VERSION = '1.04';
use warnings::register;
use strict qw(vars subs);
@@ -20,7 +20,7 @@ sub import {
Carp::croak("Can't declare individual elements of hash or array");
} elsif (warnings::enabled() and length($sym) == 1 and $sym !~ tr/a-zA-Z//) {
warnings::warn("No need to declare built-in vars");
- } elsif (($^H &= strict::bits('vars'))) {
+ } elsif (($^H & strict::bits('vars'))) {
require Carp;
Carp::croak("'$_' is not a valid variable name under strict vars");
}
diff --git a/lib/vars.t b/lib/vars.t
index 3075f8e..9b9822c 100644
--- a/lib/vars.t
+++ b/lib/vars.t
@@ -8,7 +8,7 @@ BEGIN {
$| = 1;
-print "1..27\n";
+print "1..28\n";
# catch "used once" warnings
my @warns;
@@ -103,3 +103,10 @@ print "${e}ok 26\n";
$e = !(grep(/^Global symbol "\%w" requires explicit package name/, @errs))
&& 'not ';
print "${e}ok 27\n";
+
+{
+ no strict;
+ eval 'use strict "refs"; my $zz = "abc"; use vars qw($foo$); my $y = $$zz;';
+ $e = $@ ? "" : "not ";
+ print "${e}ok 28 # use vars error check modifying other strictness\n";
+}
--
2.1.4
|
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Tue, 31 Jan 2017 21:33:58 -0800, tonyc wrote:
Applied as eda3f95 with some minor changes. Tony |
@tonycoz - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.30.0, this and 160 other issues have been Perl 5.30.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#130674 (status was 'resolved')
Searchable as RT130674$
The text was updated successfully, but these errors were encountered: