diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-12-03 21:51:45 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-12-03 21:51:45 +0000 |
commit | 133706a6af5890d9737eb5c4dacb6252623311ea (patch) | |
tree | 9cfa88f97ca4f18c0a72ee7f852eb9feda593dfe /t/op/mydef.t | |
parent | 7a1e2023d90d879c7a6110f7be3e3c6e22bddc33 (diff) | |
download | perl-133706a6af5890d9737eb5c4dacb6252623311ea.tar.gz |
$foo::_ was wrongly forced as $main::_.
Since we still want "our $_" to be always forced to $main::_,
deplace the forcing code at our-pad allocation time.
(Making execution probably a tiny bit faster)
p4raw-id: //depot/perl@23608
Diffstat (limited to 't/op/mydef.t')
-rw-r--r-- | t/op/mydef.t | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/t/op/mydef.t b/t/op/mydef.t index f089c31b0c..d2ff35b686 100644 --- a/t/op/mydef.t +++ b/t/op/mydef.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -print "1..66\n"; +print "1..70\n"; my $test = 0; sub ok ($$) { @@ -189,3 +189,12 @@ END { unlink $file; } ok( $x eq "hello\n", 'reading from <$_> works' ); close $_; } + +{ + $fqdb::_ = 'fqdb'; + ok( $fqdb::_ eq 'fqdb', 'fully qualified $_ is not in main' ); + ok( eval q/$fqdb::_/ eq 'fqdb', 'fully qualified, evaled $_ is not in main' ); + package fqdb; + ::ok( $_ ne 'fqdb', 'unqualified $_ is in main' ); + ::ok( q/$_/ ne 'fqdb', 'unqualified, evaled $_ is in main' ); +} |