| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Acme::Thoroughly::Modern::Perl; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1957
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
43
|
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
452
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = 'v0.4.1'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my @now = localtime(); |
|
9
|
|
|
|
|
|
|
my $yr = $now[5] - 100; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# This actually calculates what might be the current minimum version |
|
12
|
|
|
|
|
|
|
# for years >= 2010. |
|
13
|
|
|
|
|
|
|
my $mver = ( ( $yr - 10 ) * 2 ) + 10; |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# just in case there is a boundary case, wrap the test in a do/while |
|
16
|
|
|
|
|
|
|
# and step it up as needed. |
|
17
|
|
|
|
|
|
|
my $req_str; |
|
18
|
|
|
|
|
|
|
do { |
|
19
|
|
|
|
|
|
|
$mver += 2; # skip over devel releases |
|
20
|
|
|
|
|
|
|
my $verstr = sprintf( "%0.3f", 5 + ( $mver * .001 ) ); |
|
21
|
|
|
|
|
|
|
$req_str = "require $verstr"; |
|
22
|
|
|
|
|
|
|
} while ( eval "$req_str" ); |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# we need to warn and exit, and NOT die, if we want to more closely emulate |
|
25
|
|
|
|
|
|
|
# what is actually printed for a real failue. we exit with 255 because |
|
26
|
|
|
|
|
|
|
# that is what perl does. (but override in a test environment since it would |
|
27
|
|
|
|
|
|
|
# really suck to have 100% failures on the test matrix!) |
|
28
|
|
|
|
|
|
|
unless ( $ENV{ATMP_TEST} ) { |
|
29
|
|
|
|
|
|
|
warn "$@\n"; |
|
30
|
|
|
|
|
|
|
exit 255; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |