This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
install useful Regexp::CARP_TRACE from Carp
[perl5.git] / dist / Carp / t / vivify_stash.t
CommitLineData
f864cbea 1BEGIN { print "1..5\n"; }
778a861b
Z
2
3our $has_utf8; BEGIN { $has_utf8 = exists($::{"utf8::"}); }
bd098b9a 4our $has_overload; BEGIN { $has_overload = exists($::{"overload::"}); }
f864cbea 5our $has_B; BEGIN { $has_B = exists($::{"B::"}); }
778a861b
Z
6
7use Carp;
e94bb470 8sub { sub { Carp::longmess("x") }->() }->(\1, "\x{2603}", qr/\x{2603}/);
778a861b
Z
9
10print !(exists($::{"utf8::"}) xor $has_utf8) ? "" : "not ", "ok 1\n";
bd098b9a 11print !(exists($::{"overload::"}) xor $has_overload) ? "" : "not ", "ok 2\n";
f864cbea 12print !(exists($::{"B::"}) xor $has_B) ? "" : "not ", "ok 3\n";
778a861b 13
f2ea7462
FC
14# Autovivify $::{"overload::"}
15() = \$::{"overload::"};
16() = \$::{"utf8::"};
17eval { sub { Carp::longmess() }->(\1) };
f864cbea 18print $@ eq '' ? "ok 4\n" : "not ok 4\n# $@";
f2ea7462
FC
19
20# overload:: glob without hash
21undef *{"overload::"};
22eval { sub { Carp::longmess() }->(\1) };
f864cbea 23print $@ eq '' ? "ok 5\n" : "not ok 5\n# $@";
f2ea7462 24
778a861b 251;