| 1 | package Log::Accounting; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %MMAP); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 1 | require Exporter; | |||||||||||||||||||
| 7 | 1 | require AutoLoader; | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 1 | @ISA = qw(Exporter AutoLoader); | |||||||||||||||||||
| 10 | # Items to export into callers namespace by default. Note: do not export | ||||||||||||||||||||
| 11 | # names by default without a very good reason. Use EXPORT_OK instead. | ||||||||||||||||||||
| 12 | # Do not simply export all your public functions/methods/constants. | ||||||||||||||||||||
| 13 | 1 | @EXPORT = qw( | |||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | ); | ||||||||||||||||||||
| 16 | 1 | $VERSION = '0.3'; | |||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 1 | %MMAP = ( | |||||||||||||||||||
| 19 | "Sendmail" => "Log::Accounting::Sendmail", | ||||||||||||||||||||
| 20 | ); | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=20.8
Pod
undocumented
| |||||||||||||||||||||
| 24 | 0 | shift; | |||||||||||||||||||
| 25 | 0 | my $service = shift; | |||||||||||||||||||
| 26 | 0 | ▶ | my $impl = $MMAP{$service} || do { | ||||||||||||||||||
|
Condition0%0/3
$Log::Accounting::MMAP{$service} || do {
$service =~ s/\W+//;
"Log::Accounting::$service"
}
MC/DC0%0/2
$Log::Accounting::MMAP{$service} || do {
$service =~ s/\W+//;
"Log::Accounting::$service"
}
$Log::Accounting::MMAP{$service}
do {
$service =~ s/\W+//;
"Log::Accounting::$service"
}
Truth table0%0/3
A || B
A= $Log::Accounting::MMAP{$service}B= do {
$service =~ s/\W+//;
"Log::Accounting::$service"
}
| |||||||||||||||||||||
| 27 | 0 | $service =~ s/\W+//; | |||||||||||||||||||
| 28 | 0 | "Log::Accounting::$service"; | |||||||||||||||||||
| 29 | }; | ||||||||||||||||||||
| 30 | 1 | ▶ | no strict 'refs'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 31 | 0 | ▶ | unless (exists ${"$impl\::"}{"VERSION"}) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 32 | 0 | eval "require $impl"; | |||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | 0 | return $impl->new(@_); | |||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 1 | 1; | |||||||||||||||||||
| 38 | __END__ | ||||||||||||||||||||