#!./perl
#
# check UNIVERSAL
#
BEGIN {
chdir 't' if -d 't';
$| = 1;
}
print "1..100\n";
$a = {};
bless $a, "Bob";
print "ok 1\n";
sub eat {}
sub sing;
{
}
{
sub write_perl { 1 }
}
{ my $i = 2;
sub test {
print "ok ", $i++;
print "\n";
}
}
test $@; # ... but not if no actual subroutine
{
}
my $b = 'abc';
};
};
## The test for import here is *not* because we want to ensure that UNIVERSAL
## can always import; it is an historical accident that UNIVERSAL can import.
} else {
}
# now use UNIVERSAL.pm and see what changes
eval "use UNIVERSAL";
# XXX import being here is really a bug
} else {
}
eval 'sub UNIVERSAL::sleep {}';
{
}
{
# test isa() and can() on magic variables
"Human" =~ /(.*)/;
}
# bugid 3284
# a second call to isa('UNIVERSAL') when @ISA is null failed due to caching