File Coverage

lib/ExtUtils/MakeMaker/version.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 27 27 100.0


line stmt bran cond sub pod time code
1             #--------------------------------------------------------------------------#
2             # This is a modified copy of version.pm 0.9909, bundled exclusively for
3             # use by ExtUtils::Makemaker and its dependencies to bootstrap when
4             # version.pm is not available. It should not be used by ordinary modules.
5             #
6             # When loaded, it will try to load version.pm. If that fails, it will load
7             # ExtUtils::MakeMaker::version::vpp and alias various *version functions
8             # to functions in that module. It will also override UNIVERSAL::VERSION.
9             #--------------------------------------------------------------------------#
10              
11             package ExtUtils::MakeMaker::version;
12              
13 52     52   977 use 5.006001;
  52         187  
14 52     52   271 use strict;
  52         103  
  52         1154  
15 52     52   262 use warnings;
  52         116  
  52         1776  
16              
17 52     52   298 use vars qw(@ISA $VERSION $CLASS $STRICT $LAX *declare *qv);
  52         124  
  52         8847  
18              
19             $VERSION = '7.70';
20             $VERSION =~ tr/_//d;
21             $CLASS = 'version';
22              
23             {
24             local $SIG{'__DIE__'};
25 52     52   23154 eval "use version";
  52         176400  
  52         293  
26             if ( $@ ) { # don't have any version.pm installed
27             eval "use ExtUtils::MakeMaker::version::vpp";
28             die "$@" if ( $@ );
29 52     52   364 no warnings;
  52         116  
  52         8074  
30             delete $INC{'version.pm'};
31             $INC{'version.pm'} = $INC{'ExtUtils/MakeMaker/version.pm'};
32             push @version::ISA, "ExtUtils::MakeMaker::version::vpp";
33             $version::VERSION = $VERSION;
34             *version::qv = \&ExtUtils::MakeMaker::version::vpp::qv;
35             *version::declare = \&ExtUtils::MakeMaker::version::vpp::declare;
36             *version::_VERSION = \&ExtUtils::MakeMaker::version::vpp::_VERSION;
37             *version::vcmp = \&ExtUtils::MakeMaker::version::vpp::vcmp;
38             *version::new = \&ExtUtils::MakeMaker::version::vpp::new;
39             if ("$]" >= 5.009000) {
40 52     52   349 no strict 'refs';
  52         110  
  52         12037  
41             *version::stringify = \&ExtUtils::MakeMaker::version::vpp::stringify;
42             *{'version::(""'} = \&ExtUtils::MakeMaker::version::vpp::stringify;
43             *{'version::(<=>'} = \&ExtUtils::MakeMaker::version::vpp::vcmp;
44             *version::parse = \&ExtUtils::MakeMaker::version::vpp::parse;
45             }
46             require ExtUtils::MakeMaker::version::regex;
47             *version::is_lax = \&ExtUtils::MakeMaker::version::regex::is_lax;
48             *version::is_strict = \&ExtUtils::MakeMaker::version::regex::is_strict;
49             *LAX = \$ExtUtils::MakeMaker::version::regex::LAX;
50             *STRICT = \$ExtUtils::MakeMaker::version::regex::STRICT;
51             }
52             elsif ( ! version->can('is_qv') ) {
53             *version::is_qv = sub { exists $_[0]->{qv} };
54             }
55             }
56              
57             1;