File Coverage

blib/lib/Log/Accounting.pm
Criterion Covered Total %
statement 9 16 56.2
branch 0 2 0.0
condition 0 3 0.0
subroutine 3 4 75.0
pod 0 1 0.0
total 12 26 46.1


line stmt bran cond sub pod time code
1             package Log::Accounting;
2              
3 1     1   622 use strict;
  1         1  
  1         36  
4 1     1   5 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %MMAP);
  1         2  
  1         160  
5              
6             require Exporter;
7             require AutoLoader;
8              
9             @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             @EXPORT = qw(
14            
15             );
16             $VERSION = '0.3';
17              
18             %MMAP = (
19             "Sendmail" => "Log::Accounting::Sendmail",
20             );
21              
22              
23             sub new {
24 0     0 0   shift;
25 0           my $service = shift;
26 0   0       my $impl = $MMAP{$service} || do {
27             $service =~ s/\W+//;
28             "Log::Accounting::$service";
29             };
30 1     1   4 no strict 'refs';
  1         2  
  1         85  
31 0 0         unless (exists ${"$impl\::"}{"VERSION"}) {
  0            
32 0           eval "require $impl";
33             }
34 0           return $impl->new(@_);
35             }
36              
37             1;
38             __END__