| 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
| |||||||||||
| 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
| |||||||||||
| 29 | 0 | warn "$@\n"; | |||||||||
| 30 | 0 | exit 255; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 1 | 1; | |||||||||
| 34 | |||||||||||
| 35 | __END__ | ||||||||||