File Coverage

blib/lib/Log/Report/Optional.pm
Criterion Covered Total %
statement 19 22 86.3
branch 1 4 25.0
condition 0 3 0.0
subroutine 7 7 100.0
pod 1 1 100.0
total 28 37 75.6


line stmt bran cond sub pod time code
1             # Copyrights 2013-2018 by [Mark Overmeer ].
2             # For other contributors see ChangeLog.
3             # See the manual pages for details on the licensing terms.
4             # Pod stripped from pm file by OODoc 2.02.
5             # This code is part of distribution Log-Report-Optional. Meta-POD processed
6             # with OODoc into POD and HTML manual-pages. See README.md
7             # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8              
9             package Log::Report::Optional;
10 2     2   59601 use vars '$VERSION';
  2         13  
  2         99  
11             $VERSION = '1.06';
12              
13 2     2   10 use base 'Exporter';
  2         3  
  2         200  
14              
15 2     2   11 use warnings;
  2         4  
  2         39  
16 2     2   6 use strict;
  2         4  
  2         148  
17              
18              
19             my ($supported, @used_by);
20              
21             BEGIN {
22 2 50   2   9 if($INC{'Log/Report.pm'})
23 0         0 { $supported = 'Log::Report';
24 0         0 my $version = $Log::Report::VERSION;
25 0 0 0     0 die "Log::Report too old for ::Optional, need at least 1.00"
26             if $version && $version le '1.00';
27             }
28             else
29 2         338 { require Log::Report::Minimal;
30 2         150 $supported = 'Log::Report::Minimal';
31             }
32             }
33              
34             sub import(@)
35 2     2   17 { my $class = shift;
36 2         6 push @used_by, (caller)[0];
37 2         8 $supported->import('+1', @_);
38             }
39              
40              
41 1     1 1 973 sub usedBy() { @used_by }
42              
43             1;