diff options
author | Vincent Pit <vince@profvince.com> | 2011-11-20 11:56:11 +0100 |
---|---|---|
committer | Vincent Pit <vince@profvince.com> | 2011-11-20 11:56:41 +0100 |
commit | 7c864bb3ffceec4b5c696507d5fc0d4e9e2f13b3 (patch) | |
tree | d5efd902c10f6968c168595552f785075de62097 /t | |
parent | cbd87d8d73269d0f60e1d5c404627169d56ed661 (diff) | |
download | perl-7c864bb3ffceec4b5c696507d5fc0d4e9e2f13b3.tar.gz |
Handle require() on implicit $_ properly w/r global overrides
Those require() calls are compiled as BASEOPs, so it is invalid to look for
their op_first member when they are translated to a call to the global
override subroutine. The new entersub call should get $_ in its argument
list instead.
This fixes [perl #78260].
Diffstat (limited to 't')
-rw-r--r-- | t/op/override.t | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/t/op/override.t b/t/op/override.t index 413ba77e84..ab2cbf1515 100644 --- a/t/op/override.t +++ b/t/op/override.t @@ -6,7 +6,7 @@ BEGIN { require './test.pl'; } -plan tests => 26; +plan tests => 28; # # This file tries to test builtin override using CORE::GLOBAL @@ -52,6 +52,18 @@ is( $r, join($dirsep, "Foo", "Bar.pm") ); eval "use 5.006"; is( $r, "5.006" ); +{ + local $_ = 'foo.pm'; + require; + is( $r, 'foo.pm' ); +} + +{ + my $_ = 'bar.pm'; + require; + is( $r, 'bar.pm' ); +} + # localizing *CORE::GLOBAL::foo should revert to finding CORE::foo { local(*CORE::GLOBAL::require); |