Skip to content

Commit 8132fcf

Browse files
committed
lib/vars.t: Properly scope some variables. TODO
However, the file still fails to compile, starting with: '$X::p' is not a valid variable name under strict vars at ../lib/vars.t line 22.
1 parent ac6b7cc commit 8132fcf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/vars.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ print "1..28\n";
1414
my @warns;
1515
BEGIN { $SIG{__WARN__} = sub { push @warns, @_ }; $^W = 1 };
1616

17-
%x = ();
18-
$y = 3;
19-
@z = ();
17+
my %x = ();
18+
my $y = 3;
19+
my @z = ();
2020
$X::x = 13;
2121

2222
use vars qw($p @q %r *s &t $X::p);
@@ -35,7 +35,7 @@ print "${e}ok 5\n";
3535
# this is inside eval() to avoid creation of symbol table entries and
3636
# to avoid "used once" warnings
3737
eval <<'EOE';
38-
$e = ! $main::{p} && 'not ';
38+
my $e = ! $main::{p} && 'not ';
3939
print "${e}ok 6\n";
4040
$e = ! *q{ARRAY} && 'not ';
4141
print "${e}ok 7\n";

0 commit comments

Comments
 (0)