From: Karen Etheridge Date: Fri, 20 Apr 2018 13:10:32 +0000 (+0200) Subject: stringify version before comparing, as recommended by Zefram X-Git-Tag: v2.000005~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e12af862ff034c1757248c0faf517ad2a917e5c9;p=p5sagit%2Fstrictures.git stringify version before comparing, as recommended by Zefram --- diff --git a/Makefile.PL b/Makefile.PL index 3bb6c81..8428b85 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -59,7 +59,7 @@ my %META = ( my %MM_ARGS = ( PREREQ_PM => { - ($] >= 5.008004 && $have_compiler ? %extra_prereqs : () ) + ("$]" >= 5.008004 && $have_compiler ? %extra_prereqs : () ) }, ); diff --git a/lib/strictures.pm b/lib/strictures.pm index 8831249..5e12c82 100644 --- a/lib/strictures.pm +++ b/lib/strictures.pm @@ -4,10 +4,10 @@ use strict; use warnings FATAL => 'all'; BEGIN { - *_PERL_LT_5_8_4 = ($] < 5.008004) ? sub(){1} : sub(){0}; + *_PERL_LT_5_8_4 = ("$]" < 5.008004) ? sub(){1} : sub(){0}; # goto &UNIVERSAL::VERSION usually works on 5.8, but fails on some ARM # machines. Seems to always work on 5.10 though. - *_CAN_GOTO_VERSION = ($] >= 5.010000) ? sub(){1} : sub(){0}; + *_CAN_GOTO_VERSION = ("$]" >= 5.010000) ? sub(){1} : sub(){0}; } our $VERSION = '2.000005'; diff --git a/t/crash.t b/t/crash.t index 4aebc1c..44bb461 100644 --- a/t/crash.t +++ b/t/crash.t @@ -1,7 +1,7 @@ use strict; use warnings FATAL => 'all'; use Test::More - $] < 5.008004 ? ( skip_all => "can't test extra loading on perl < 5.8.4" ) + "$]" < 5.008004 ? ( skip_all => "can't test extra loading on perl < 5.8.4" ) : ( tests => 1 ); use File::Spec; diff --git a/t/extras.t b/t/extras.t index 33654e5..a71d46a 100644 --- a/t/extras.t +++ b/t/extras.t @@ -3,7 +3,7 @@ use strict; use warnings; use Test::More 0.88; -plan skip_all => 'Extra tests disabled on perls <= 5.008003' unless $] >= 5.008_004; +plan skip_all => 'Extra tests disabled on perls <= 5.008003' unless "$]" >= 5.008_004; use File::Temp; use Cwd 'cwd';