6 use Carp qw(carp cluck croak confess);
12 $SIG{__WARN__} = sub {
14 if $_[0] =~ m!ok (\d+)$! };
18 $SIG{__WARN__} = sub {
20 if $_[0] =~ m!(\d+) at .+\b(?i:carp\.t) line \d+$! };
26 $SIG{__WARN__} = sub {
28 if $_[0] =~ m!^(\d+) at .+\b(?i:carp\.t) line \d+\n\tmain::sub_4\(\) called at .+\b(?i:carp\.t) line \d+$! };
38 if $_[0] =~ m!^(\d+) at .+\b(?i:carp\.t) line \d+\n\teval \Q{...}\E called at .+\b(?i:carp\.t) line \d+$! };
45 if $_[0] =~ m!^(\d+) at .+\b(?i:carp\.t) line \d+\n\teval \Q{...}\E called at .+\b(?i:carp\.t) line \d+\n\tmain::sub_6\(\) called at .+\b(?i:carp\.t) line \d+$! };
54 # test for caller_info API
55 my $eval = "use Carp::Heavy; return Carp::caller_info(0);";
56 my %info = eval($eval);
57 print "not " if ($info{sub_name} ne "eval '$eval'");
60 # test for '...::CARP_NOT used only once' warning from Carp::Heavy
66 sub { if( defined $^S ){ warn $_[0] } else { $warning = $_[0] } }
69 BEGIN { eval { Carp::croak() } }
71 print $warning ? "not ok 9\n#$warning" : "ok 9\n";