1use strict;
2use warnings;
3
4BEGIN { print "1..5\n"; }
5
6our $has_utf8; BEGIN { $has_utf8 = exists($::{"utf8::"}); }
7our $has_B; BEGIN { $has_B = exists($::{"B::"}); }
8our $has_UNIVERSAL_isa; BEGIN { $has_UNIVERSAL_isa = exists($UNIVERSAL::{"isa::"}); }
9
10use Carp;
11sub { sub { Carp::longmess("x") }->() }->(\1, "\x{2603}", qr/\x{2603}/);
12
13print !(exists($::{"utf8::"}) xor $has_utf8) ? "" : "not ", "ok 1 # used utf8\n";
14print !(exists($::{"B::"}) xor $has_B) ? "" : "not ", "ok 2 # used B\n";
15print !(exists($UNIVERSAL::{"isa::"}) xor $has_UNIVERSAL_isa) ? "" : "not ", "ok 3 # used UNIVERSAL::isa\n";
16
17# Autovivify $::{"overload::"}
18() = \$::{"overload::"};
19() = \$::{"utf8::"};
20eval { sub { Carp::longmess() }->(\1) };
21print $@ eq '' ? "ok 4 # longmess check1\n" : "not ok 4 # longmess check1\n# $@";
22
23# overload:: glob without hash
24# Clear overload quoted so it happens to the runtime stash.
25{ no strict 'refs'; undef *{"overload::"} }
26eval { sub { Carp::longmess() }->(\1) };
27print $@ eq '' ? "ok 5 # longmess check2\n" : "not ok 5 # longmess check2\n# $@";
28
291;
30