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 $].
my $is_as_822 = 0;
print "Checking if this is ActiveState Perl 5.8.8 build 822 or higher... ";
-if ($^V eq v5.8.8 and defined $as_perl and $as_perl >= 822) {
+if ("$]" == 5.008008 and defined $as_perl and $as_perl >= 822) {
$is_as_822 = 1;
push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=1';
}
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, '-DVMG_MULTIPLICITY=0';
print "Thread safety disabled for perl 5.8.x on Windows.\n"
}
# 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, '-DVMG_FORKSAFE=0';
print "Fork safety not ensured for perl 5.8.x and 5.10.0 on Windows.\n";
}
CODE
skip 'Test code didn\'t run properly' => $count unless defined $output;
my $suffix = "\nExecution(?s:.*)";
- if ($] >= 5.011005) {
+ if ("$]" >= 5.011005) {
$suffix = "(?:\nsalsify at -e line \\d+.){12}" . $suffix;
- } elsif ($] >= 5.011) {
+ } elsif ("$]" >= 5.011) {
$suffix = "(?:\nsalsify at -e line \\d+.){3}" . $suffix;
}
like $output, expect('salsify', '-e', $suffix),
sub Variable::Magic::TestPkg::foo { }
-my $is_5130_release = ($] == 5.013 && !$Config{git_describe}) ? 1 : 0;
+my $is_5130_release = ("$]" == 5.013 && !$Config{git_describe}) ? 1 : 0;
-my $aelem = $] <= 5.008003 ? 'aelem'
- : ($] < 5.013 or $is_5130_release) ? 'aelemfast'
- : 'sassign';
-my $aelemf = ($] < 5.013 or $is_5130_release) ? 'aelemfast' : 'sassign';
+my $aelem = "$]" <= 5.008003 ? 'aelem'
+ : ("$]" < 5.013 or $is_5130_release)
+ ? 'aelemfast'
+ : 'sassign';
+my $aelemf = ("$]" < 5.013 or $is_5130_release) ? 'aelemfast' : 'sassign';
my $aelemf_op = $aelemf eq 'sassign'
? 'B::BINOP' : $Config{useithreads} ? 'B::PADOP' : 'B::SVOP';
use lib 't/lib';
use Variable::Magic::TestWatcher;
-my $is_5130_release = ($] == 5.013 && !$Config{git_describe}) ? 1 : 0;
+my $is_5130_release = ("$]" == 5.013 && !$Config{git_describe}) ? 1 : 0;
my $wiz = init_watcher
[ qw<get set len clear free copy dup local fetch store exists delete> ],
is $b, 1, 'scalar: array element: exists correctly';
# $b has to be set inside the block for the test to pass on 5.8.3 and lower
-watch { $b = delete $a[1] } { get => 1, free => ($] > 5.008005 ? 1 : 0) }, 'array element: delete';
+watch { $b = delete $a[1] } { get => 1, free => ("$]" > 5.008005 ? 1 : 0) },
+ 'array element: delete';
is $b, 6, 'scalar: array element: delete correctly';
watch { $a[1] = 4 } { }, 'array element: set after delete';
watch { cast *b, $wiz } +{ }, 'cast 2';
} +{ }, 'scope end';
-%get = () if $] >= 5.013007;
+%get = () if "$]" >= 5.013007;
watch { undef *a } +{ %get }, 'undef';
is $@, "ok\n", 'stash: function calls compiled fine';
is_deeply \%mg, {
fetch => \@calls,
- store => ($] < 5.011002 ? \@calls : [ map { ($_) x 2 } @calls ]),
+ store => ("$]" < 5.011002 ? \@calls : [ map { ($_) x 2 } @calls ]),
}, 'stash: function calls';
}
CB
} qw<fetch store exists delete>);
-my $uo_exp = $] < 5.011002 ? 2 : 3;
+my $uo_exp = "$]" < 5.011002 ? 2 : 3;
$code .= ', data => sub { +{ guard => 0 } }';
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";
skipall "threads::shared $ts_v required to test thread safety"
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";
skipall "threads::shared $ts_v required to test thread safety"