| 1 | package Aion::Carp; | ||||||||||||||||||||
| 2 | 1 | ▶ | use 5.008001; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 1 | ▶ | use common::sense; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | our $VERSION = "1.6"; | |||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 1 | ▶ | use Carp qw//; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 1 | ▶ | use Scalar::Util qw//; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 7 | ▶ | sub handler { | ||||||||||||||||||
|
Subroutine
handler: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||
| 11 | 7 | my ($x) = @_; | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 7 | ▶ | if(!ref $x) { | ||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||
| 14 | 1 | ▶ | no utf8; use bytes; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 15 | 4 | ▶ | if($x =~ s/\n[ \t]+\.\.\.propagated at .* line \d+\.\n\z/\n/) {} | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 16 | else { | ||||||||||||||||||||
| 17 | 3 | $x =~ s/ at .*? line \d+\.\n\z//; | |||||||||||||||||||
| 18 | 3 | my $c = Carp::longmess(''); | |||||||||||||||||||
| 19 | 3 | $c =~ s/^( at .*? line \d+)\.\n/$x\n\tdie(...) called$1\n/; | |||||||||||||||||||
| 20 | 3 | $x = $c; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | ▶ | elsif(Scalar::Util::reftype($x) eq "HASH" && !exists $x->{STACKTRACE}) { | |||||||||||||||||||
|
Condition100%3/3
builtin::reftype($x) eq "HASH" and not exists $x->{"STACKTRACE"}
MC/DC100%2/2
builtin::reftype($x) eq "HASH" and not exists $x->{"STACKTRACE"}
builtin::reftype($x) eq "HASH"
not exists $x->{"STACKTRACE"}
Truth table100%3/3
A and not(B)
A= builtin::reftype($x) eq "HASH"B= not exists $x->{"STACKTRACE"}
| |||||||||||||||||||||
| 24 | 1 | my $c = Carp::longmess("die(...) called"); | |||||||||||||||||||
| 25 | 1 | $c =~ s/^(.*\d+)\.\n/$1\n/; | |||||||||||||||||||
| 26 | 1 | $x->{STACKTRACE} = $c; | |||||||||||||||||||
| 27 | } | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 7 | die $x; | |||||||||||||||||||
| 30 | } | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 2 | ▶ | sub import { | ||||||||||||||||||
|
Subroutine
import: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 33 | 2 | $SIG{__DIE__} = \&handler; | |||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 1 | 1; | |||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | __END__ | ||||||||||||||||||||