require './test.pl';
}
-plan tests => 21;
+plan tests => 22;
#
# This file tries to test builtin override using CORE::GLOBAL
# Non-global readline() override
BEGIN { *Rgs::readline = sub (;*) { --$r }; }
-package Rgs;
-::is( <FH> , 13 );
-::is( <$fh> , 12 );
-::is( <$pad_fh> , 11 );
+{
+ package Rgs;
+ ::is( <FH> , 13 );
+ ::is( <$fh> , 12 );
+ ::is( <$pad_fh> , 11 );
+}
# Verify that the parsing of overriden keywords isn't messed up
# by the indirect object notation
warn OverridenWarn->foo();
}
BEGIN { *OverridenPop::pop = sub { ::is( $_[0][0], "ok" ) }; }
-package OverridenPop;
-sub foo { [ "ok" ] }
-pop( OverridenPop->foo() );
-pop OverridenPop->foo();
+{
+ package OverridenPop;
+ sub foo { [ "ok" ] }
+ pop( OverridenPop->foo() );
+ pop OverridenPop->foo();
+}
+
+{
+ eval {
+ local *CORE::GLOBAL::require = sub {
+ CORE::require($_[0]);
+ };
+ require 5;
+ require Text::ParseWords;
+ };
+ is $@, '';
+}