blib/lib/Acme/Thoroughly/Modern/Perl.pm

filter: Statementstmt 89.4% 17 / 19 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 88.0% 22 / 25 CC 1 SCAR 0.0
CC
1
Cov
87%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 package Acme::Thoroughly::Modern::Perl;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = 'v0.4.1';
7  
8 1 my @now = localtime();
9 1 my $yr = $now[5] - 100;
10  
11 # This actually calculates what might be the current minimum version
12 # for years >= 2010.
13 1 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 1 my $req_str;
18 1 ▶do {
Branch: 1 branch
BranchTrueFalseTotal
eval "$req_str" and do { do { $mver += 2; my $verstr = sprintf("%0.3f", 5 + $mver * "0.001"); $req_str = "require $verstr" } } 1 1 2
19 2 $mver += 2; # skip over devel releases
20 2 my $verstr = sprintf( "%0.3f", 5 + ( $mver * .001 ) );
21 2 $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 1 ▶unless ( $ENV{ATMP_TEST} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($ENV{"ATMP_TEST"}) 0 1 1
29 0 warn "$@\n";
30 0 exit 255;
31 }
32  
33 1 1;
34  
35 __END__
↑ Summary