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-2021 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   71806 use vars '$VERSION';
  2         16  
  2         124  
11             $VERSION = '1.07';
12              
13 2     2   12 use base 'Exporter';
  2         3  
  2         259  
14              
15 2     2   13 use warnings;
  2         4  
  2         51  
16 2     2   10 use strict;
  2         4  
  2         167  
17              
18              
19             my ($supported, @used_by);
20              
21             BEGIN {
22 2 50   2   11 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         472 { require Log::Report::Minimal;
30 2         202 $supported = 'Log::Report::Minimal';
31             }
32             }
33              
34             sub import(@)
35 2     2   21 { my $class = shift;
36 2         7 push @used_by, (caller)[0];
37 2         10 $supported->import('+1', @_);
38             }
39              
40              
41 1     1 1 1350 sub usedBy() { @used_by }
42              
43             1;