From: Vincent Pit Date: Wed, 24 Aug 2011 14:35:32 +0000 (+0200) Subject: Replace $] by "$]" X-Git-Tag: v0.10~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Fautovivification.git;a=commitdiff_plain;h=acd04c4caf2a342c115cd053dd5552a9ae2c414a 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 0573f82..bffe160 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -34,12 +34,12 @@ if ($^O eq 'MSWin32' and not grep /^LD[A-Z]*=/, @ARGV) { print $is_gcc_34 ? "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, '-DA_MULTIPLICITY=0'; } # Fork emulation got "fixed" in 5.10.1 -if ($^O eq 'MSWin32' && $^V lt v5.10.1) { +if ($^O eq 'MSWin32' && "$]" < 5.010001) { push @DEFINES, '-DA_FORKSAFE=0'; } diff --git a/samples/hash2array.pl b/samples/hash2array.pl index d58d205..d703ada 100644 --- a/samples/hash2array.pl +++ b/samples/hash2array.pl @@ -102,7 +102,7 @@ while (<$hash_kv_t>) { if (/\bplan\s*[\s\(]\s*tests\b/) { s/\s*;?\s*$//; s/^(\s*)//; - $_ = "$1if (\$] >= 5.011) { $_ } else { plan skip_all => 'perl 5.11 required for keys/values \@array' }\n"; + $_ = qq($1if ("\$]" >= 5.011) { $_ } else { plan skip_all => 'perl 5.11 required for keys/values \@array' }\n); } } else { $_ = convert_testcase($_, 1); diff --git a/t/32-array-kv.t b/t/32-array-kv.t index 64168d1..e84c7de 100644 --- a/t/32-array-kv.t +++ b/t/32-array-kv.t @@ -7,7 +7,7 @@ use lib 't/lib'; use Test::Leaner; BEGIN { - if ($] >= 5.011) { plan tests => 9 * 3 * 64 } else { plan skip_all => 'perl 5.11 required for keys/values @array' } + if ("$]" >= 5.011) { plan tests => 9 * 3 * 64 } else { plan skip_all => 'perl 5.11 required for keys/values @array' } } use autovivification::TestCases; diff --git a/t/40-scope.t b/t/40-scope.t index c79caaf..2e2afb8 100644 --- a/t/40-scope.t +++ b/t/40-scope.t @@ -38,7 +38,7 @@ our $blurp; is $@, '', 'second require test doesn\'t croak prematurely'; my $expect; $expect = { r1_main => { }, r1_eval => { } }; - $expect->{r2_eval} = { } if $] < 5.009005; + $expect->{r2_eval} = { } if "$]" < 5.009005; is_deeply $blurp, $expect, 'second require test didn\'t vivify'; } diff --git a/t/50-threads.t b/t/50-threads.t index 4a01c7c..9c09545 100644 --- a/t/50-threads.t +++ b/t/50-threads.t @@ -16,7 +16,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; } use threads; @@ -66,7 +66,7 @@ BEGIN { SKIP: { skip 'Hints aren\'t propagated into eval STRING below perl 5.10' => 3 * 2 - unless $] >= 5.010; + unless "$]" >= 5.010; { my $x; eval 'my $y = $x->{foo}'; diff --git a/t/51-threads-teardown.t b/t/51-threads-teardown.t index 8cb64f3..e5461c6 100644 --- a/t/51-threads-teardown.t +++ b/t/51-threads-teardown.t @@ -16,7 +16,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; } use threads; @@ -43,7 +43,7 @@ sub run_perl { SKIP: { - skip 'Fails on 5.8.2 and lower' => 1 if $] <= 5.008002; + skip 'Fails on 5.8.2 and lower' => 1 if "$]" <= 5.008002; my $status = run_perl <<' RUN'; my $code = 1 + 2 + 4;