File Coverage

blib/lib/Log/Report/Optional.pm
Criterion Covered Total %
statement 16 19 84.2
branch 1 4 25.0
condition 0 3 0.0
subroutine 6 6 100.0
pod 1 1 100.0
total 24 33 72.7


line stmt bran cond sub pod time code
1             # This code is part of Perl distribution Log-Report-Optional version 1.08.
2             # The POD got stripped from this file by OODoc version 3.04.
3             # For contributors see file ChangeLog.
4              
5             # This software is copyright (c) 2013-2025 by Mark Overmeer.
6              
7             # This is free software; you can redistribute it and/or modify it under
8             # the same terms as the Perl 5 programming language system itself.
9             # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10              
11             #oodist: *** DO NOT USE THIS VERSION FOR PRODUCTION ***
12             #oodist: This file contains OODoc-style documentation which will get stripped
13             #oodist: during its release in the distribution. You can use this file for
14             #oodist: testing, however the code of this development version may be broken!
15              
16             package Log::Report::Optional;{
17             our $VERSION = '1.08';
18             }
19              
20 2     2   132863 use base 'Exporter';
  2         5  
  2         328  
21              
22 2     2   10 use warnings;
  2         5  
  2         148  
23 2     2   9 use strict;
  2         2  
  2         248  
24              
25             #--------------------
26              
27             my ($supported, @used_by);
28              
29             BEGIN {
30 2 50   2   11 if($INC{'Log/Report.pm'})
31 0         0 { $supported = 'Log::Report';
32 0         0 my $version = $Log::Report::VERSION;
33 0 0 0     0 die "Log::Report too old for ::Optional, need at least 1.00"
34             if $version && $version le '1.00';
35             }
36             else
37 2         709 { require Log::Report::Minimal;
38 2         279 $supported = 'Log::Report::Minimal';
39             }
40             }
41              
42             sub import(@)
43 2     2   26 { my $class = shift;
44 2         9 push @used_by, (caller)[0];
45 2         14 $supported->import('+1', @_);
46             }
47              
48             #--------------------
49              
50 1     1 1 2186 sub usedBy() { @used_by }
51              
52             1;