From: Vincent Pit Date: Mon, 18 Jul 2011 14:16:57 +0000 (+0200) Subject: Replace $] by "$]" X-Git-Tag: v0.15~5 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=commitdiff_plain;h=e26cff534d772ff66c0cdf5761787f43c6b7c5ec Replace $] by "$]" An old bug could cause $] to be initialized to a wrong decimal value. Since its stringified value was always right, we use it instead. Occurences of $^V were also replaced by $]. --- diff --git a/Makefile.PL b/Makefile.PL index f4df485..a88b816 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -15,13 +15,13 @@ for ($pl, $desc) { my @DEFINES; print "Checking if this is an official release of perl... "; -my $is_release = ($] < 5.011) ? (defined($pl) || defined($desc) ? 0 : 1) - : (defined($desc) ? 0 : 1); +my $is_release = ("$]" < 5.011) ? (defined($pl) || defined($desc) ? 0 : 1) + : (defined($desc) ? 0 : 1); push @DEFINES, "-DSU_RELEASE=$is_release"; print $is_release ? "yes\n" : "no\n"; # Threads, Windows and 5.8.x don't seem to be best friends -if ($^O eq 'MSWin32' && $^V lt v5.9.0) { +if ($^O eq 'MSWin32' && "$]" < 5.009) { push @DEFINES, '-DSU_MULTIPLICITY=0'; } diff --git a/t/13-reap-ctl.t b/t/13-reap-ctl.t index 3f5db2b..6208642 100644 --- a/t/13-reap-ctl.t +++ b/t/13-reap-ctl.t @@ -137,7 +137,7 @@ $y = undef; SKIP: { - skip 'Perl 5.10 required to test given/when' => 30 if $] < 5.010; + skip 'Perl 5.10 required to test given/when' => 30 if "$]" < 5.010; eval <<' GIVEN_TEST_1'; use feature 'switch'; diff --git a/t/20-localize-target.t b/t/20-localize-target.t index c352456..ad3574b 100644 --- a/t/20-localize-target.t +++ b/t/20-localize-target.t @@ -66,7 +66,8 @@ undef *x; SKIP: { - skip 'Can\'t localize through a reference before 5.8.1' => 2 if $] < 5.008001; + skip 'Can\'t localize through a reference before 5.8.1' => 2 + if "$]" < 5.008001; eval q{ no strict 'refs'; local ${''} = 9; @@ -80,7 +81,8 @@ SKIP: SKIP: { - skip 'Can\'t localize through a reference before 5.8.1' => 2 if $] < 5.008001; + skip 'Can\'t localize through a reference before 5.8.1' => 2 + if "$]" < 5.008001; eval q{ no strict 'refs'; local ${''} = 10; diff --git a/t/23-localize-ctl.t b/t/23-localize-ctl.t index 0bd3563..5f4046e 100644 --- a/t/23-localize-ctl.t +++ b/t/23-localize-ctl.t @@ -190,7 +190,7 @@ $y = undef; SKIP: { - skip 'Perl 5.10 required to test given/when' => 30 if $] < 5.010; + skip 'Perl 5.10 required to test given/when' => 30 if "$]" < 5.010; eval <<' GIVEN_TEST_1'; use feature 'switch'; diff --git a/t/44-localize_delete-magic.t b/t/44-localize_delete-magic.t index 1a62829..d118fae 100644 --- a/t/44-localize_delete-magic.t +++ b/t/44-localize_delete-magic.t @@ -54,7 +54,8 @@ our @a; SKIP: { - skip '$NEGATIVE_INDICES has no special meaning on 5.8.0 and older' => 2 if $] < 5.008_001; + skip '$NEGATIVE_INDICES has no special meaning on 5.8.0 and older' => 2 + if "$]" < 5.008001; local $Scope::Upper::Test::TiedArray::NEGATIVE_INDICES = 1; local @a; tie @a, 'Scope::Upper::Test::TiedArray'; diff --git a/t/59-unwind-threads.t b/t/59-unwind-threads.t index 236df4c..65ef827 100644 --- a/t/59-unwind-threads.t +++ b/t/59-unwind-threads.t @@ -17,7 +17,7 @@ BEGIN { skipall 'This perl wasn\'t built to support threads' unless $Config{useithreads}; skipall 'perl 5.13.4 required to test thread safety' - unless $force or $] >= 5.013004; + unless $force or "$]" >= 5.013004; skipall "threads $t_v required to test thread safety" unless eval "use threads $t_v; 1"; } diff --git a/t/lib/Scope/Upper/TestGenerator.pm b/t/lib/Scope/Upper/TestGenerator.pm index 18ced24..a04148d 100644 --- a/t/lib/Scope/Upper/TestGenerator.pm +++ b/t/lib/Scope/Upper/TestGenerator.pm @@ -26,7 +26,7 @@ my @blocks = ( ); sub import { - if ($] >= 5.010001) { + if ("$]" >= 5.010001) { push @blocks, [ 'given (1) {', '}' ]; require feature; feature->import('switch');