line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package version::Limit; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
require 5.005_03; |
4
|
1
|
|
|
1
|
|
904
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
5
|
1
|
|
|
1
|
|
919
|
use version 0.6701; |
|
1
|
|
|
|
|
2441
|
|
|
1
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
91
|
use vars qw/@ISA $VERSION/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
619
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$VERSION = 0.0301; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Preloaded methods go here. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub import { |
18
|
2
|
|
|
2
|
|
1216
|
my $self = shift; |
19
|
2
|
|
|
|
|
8
|
my $package = (caller())[0]; |
20
|
2
|
|
|
|
|
62
|
$self->SUPER::import(@_); |
21
|
2
|
|
|
|
|
139
|
$self->export_to_level(1,$self,@_); |
22
|
2
|
|
|
|
|
131
|
eval "\*$package\::VERSION = \\&_VERSION"; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub Scope { |
26
|
1
|
|
|
1
|
0
|
144
|
my $package = (caller())[0]; |
27
|
1
|
|
|
|
|
3
|
my $self; |
28
|
1
|
50
|
|
|
|
9
|
if ( scalar(@_) % 2 == 1 ) { # called as class method |
29
|
0
|
|
|
|
|
0
|
$self = shift; |
30
|
|
|
|
|
|
|
} |
31
|
1
|
|
|
|
|
5
|
while ( @_ ) { |
32
|
2
|
|
|
|
|
4
|
my ($range, $reason) = (shift, shift); |
33
|
2
|
|
|
|
|
3
|
${$package::_INCOMPATIBILITY}{$range} = $reason; |
|
2
|
|
|
|
|
10
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _VERSION { |
38
|
8
|
|
|
8
|
|
10982
|
my ($package,$req) = @_; |
39
|
8
|
|
|
|
|
106
|
$req = version->new($req); |
40
|
8
|
|
|
|
|
433
|
my $version = version->new(eval("\$$package\::VERSION")); |
41
|
8
|
100
|
|
|
|
95
|
if ( $req > $version ) { |
42
|
1
|
|
|
|
|
25
|
die "$package version $req required--this is only version $version"; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
7
|
|
|
|
|
10
|
my @ranges = keys %{$package::_INCOMPATIBILITY}; |
|
7
|
|
|
|
|
28
|
|
46
|
7
|
|
|
|
|
17
|
foreach my $range ( @ranges ) { |
47
|
12
|
|
|
|
|
68
|
my ($lb,$lower,$upper,$ub) = |
48
|
|
|
|
|
|
|
( $range =~ /(.)([0-9.]+),([0-9.]+)(.)/ ); |
49
|
12
|
50
|
|
|
|
31
|
$lb = '>' . ( $lb eq '[' ? '=' : ''); |
50
|
12
|
50
|
|
|
|
22
|
$ub = '<' . ( $ub eq ']' ? '=' : ''); |
51
|
12
|
|
|
|
|
77
|
$lower = version->new($lower); |
52
|
12
|
|
|
|
|
214
|
$upper = version->new($upper); |
53
|
12
|
|
|
|
|
28
|
my $test = "(\$req $lb \$lower and \$req $ub \$upper)"; |
54
|
12
|
100
|
|
|
|
641
|
if ( eval $test ) { |
55
|
4
|
|
|
|
|
88
|
die "Cannot 'use $package $req': " |
56
|
4
|
|
|
|
|
22
|
. ${$package::_INCOMPATIBILITY}{$range} |
57
|
|
|
|
|
|
|
."\n".$test; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
3
|
|
|
|
|
47
|
return $version; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
__END__ |