12 # This file tries to test builtin override using CORE::GLOBAL
16 BEGIN { package Foo; *main::getlogin = sub { "kilroy"; } }
18 print "not " unless getlogin eq "kilroy";
22 BEGIN { *CORE::GLOBAL::time = sub () { $t; } }
24 print "not " unless 45 == time + 3;
28 # require has special behaviour
31 BEGIN { *CORE::GLOBAL::require = sub { $r = shift; 1; } }
34 print "not " unless $r eq "Foo.pm";
38 print "not " unless $r eq join($dirsep, "Foo", "Bar.pm");
42 print "not " unless $r eq "Foo";
46 print "not " unless $r eq "5.6";
50 print "not " unless $r == 5.006 && $r eq "\x05\x06";
54 print "not " unless $r eq "Foo.pm";
58 print "not " unless $r eq join($dirsep, "Foo", "Bar.pm");
62 print "not " unless $r eq "5.6";