Message-ID: <15393.4370.605214.548582@rls.cx>
p4raw-id: //depot/perl@13816
use Carp qw(carp cluck croak confess);
-print "1..7\n";
+print "1..8\n";
print "ok 1\n";
print "ok 7\n";
+# test for caller_info API
+my $eval = "use Carp::Heavy; return Carp::caller_info(0);";
+my %info = eval($eval);
+print "not " if ($info{sub_name} ne "eval '$eval'");
+print "ok 8\n";
# the sub/require/eval
sub get_subname {
my $info = shift;
- if (defined($info->{eval})) {
- my $eval = $info->{eval};
+ if (defined($info->{evaltext})) {
+ my $eval = $info->{evaltext};
if ($info->{is_require}) {
return "require $eval";
}
else {
$eval =~ s/([\\\'])/\\$1/g;
- return str_len_trim($eval, $MaxEvalLen);
+ return "eval '" . str_len_trim($eval, $MaxEvalLen) . "'";
}
}