| 1 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | package Email::Pipemailer::DieHandler; | ||||||||||||||||||||||||||||
| 4 | { | ||||||||||||||||||||||||||||
| 5 | 2 | $Email::Pipemailer::DieHandler::VERSION = '1.001'; | |||||||||||||||||||||||||||
| 6 | } | ||||||||||||||||||||||||||||
| 7 | # ABSTRACT: do not die embarassingly if you screw up your pipemailer | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | sub import { | ||||||||||||||||||||||||||||
| 11 | 0 | ▶ | my ($self, $install, $arg) = @_; | ||||||||||||||||||||||||||
|
Subroutine
import: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||
| 12 | 0 | ▶ | return unless $install and $install eq '-install'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$install and $install eq "-install"
MC/DC0%0/2
$install and $install eq "-install"
$install
$install eq "-install"
Truth table0%0/3
A and B
A= $installB= $install eq "-install"
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 0 | ▶ | $arg ||= {}; | ||||||||||||||||||||||||||
|
Condition0%0/2
$arg ||= {}
MC/DC0%0/1
$arg ||= {}
$arg
Truth table0%0/2
A
A= $arg
| |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | my $logger = $arg->{logger} || sub {}; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$arg->{'logger'} || sub {
}
MC/DC0%0/2
$arg->{'logger'} || sub {
}
$arg->{'logger'}
sub {
}
Truth table0%0/3
A || B
A= $arg->{'logger'}B= sub {
}
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | $SIG{__DIE__} = sub { | ||||||||||||||||||||||||||||
| 18 | 0 | ▶ | return if $^S; # don't interfere with evals | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | 0 | my ($e) = @_; | |||||||||||||||||||||||||||
| 20 | 0 | ▶ | defined $^S and eval { $logger->($e); }; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 0 | $! = 75; | |||||||||||||||||||||||||||
| 22 | 0 | die $e; | |||||||||||||||||||||||||||
| 23 | 0 | }; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 2 | 1; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | __END__ | ||||||||||||||||||||||||||||