File Coverage

lib/Image/Info/SVG.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             # -*- perl -*-
2              
3             #
4             # Author: Slaven Rezic
5             #
6             # Copyright (C) 2009,2011,2016,2017 Slaven Rezic. All rights reserved.
7             # This package is free software; you can redistribute it and/or
8             # modify it under the same terms as Perl itself.
9             #
10              
11             package Image::Info::SVG;
12              
13 2     2   13 use strict;
  2         4  
  2         76  
14 2     2   10 use vars qw($VERSION @PREFER_MODULE $USING_MODULE);
  2         3  
  2         228  
15             $VERSION = '2.04';
16              
17             @PREFER_MODULE = qw(Image::Info::SVG::XMLLibXMLReader
18             Image::Info::SVG::XMLSimple
19             )
20             if !@PREFER_MODULE;
21              
22             TRY_MODULE: {
23             for my $try_module (@PREFER_MODULE) {
24             if (eval qq{ require $try_module; 1 }) {
25             my $sub = $try_module . '::process_file';
26 2     2   13 no strict 'refs';
  2         3  
  2         193  
27             *process_file = \&{$sub};
28             $USING_MODULE = $try_module;
29             last TRY_MODULE;
30             }
31             }
32             die "Cannot require any of @PREFER_MODULE...\n";
33             }
34              
35             1;
36              
37             __END__