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 $].
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, '-DLT_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, '-DLT_FORKSAFE=0';
}
{
my $expect = qr/^Lexical::Types mangler should return zero, one or two scalars, but got 3/;
- diag 'This will throw two warnings' if $] >= 5.008008 and $] < 5.009;
+ diag 'This will throw two warnings' if "$]" >= 5.008008 and "$]" < 5.009;
local $@;
eval q[
use Lexical::Types as => sub { qw<a b c> };
{
my $expect = qr/^banana at \(eval \d+\) line 2/;
- diag 'This will throw two more warnings' if $] >= 5.008008 and $] < 5.009;
+ diag 'This will throw two more warnings' if "$]" >= 5.008008 and "$]" < 5.009;
local $@;
eval q[
use Lexical::Types as => sub { die 'banana' };
SKIP: {
skip 'Broken with threaded perls before 5.8.4' => 1
- if $Config{useithreads} and $] < 5.008004;
+ if $Config{useithreads} and "$]" < 5.008004;
use Lexical::Types as => sub {
# In 5.10, this closure is compiled before hints are enabled, so no hintseval
}
sub maybe_warn {
- diag 'This will throw two warnings' if $] >= 5.008008 and $] < 5.009;
+ diag 'This will throw two warnings' if "$]" >= 5.008008 and "$]" < 5.009;
}
{
}
SKIP: {
- skip 'Kinda broken on old 5.8.x' => 1 if $] <= 5.008006;
+ skip 'Kinda broken on old 5.8.x' => 1 if "$]" <= 5.008006;
maybe_warn();
local $@;
eval q!
::is($z, __FILE__.':6', 'pragma in use at the end');
}
TESTREQUIRED3
- @w = grep !/^warn:Attempt\s+to\s+free\s+unreferenced/, @w if $] <= 5.008003;
+ @w = grep !/^warn:Attempt\s+to\s+free\s+unreferenced/, @w if "$]" <= 5.008003;
is $@, '', 'third require test didn\'t croak prematurely';
is_deeply \@w, [ ], 'third require test didn\'t warn';
is_deeply \@decls, [ map "Int3$_", qw<X Z> ],
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;
SKIP:
{
skip 'Hints aren\'t propagated into eval STRING below perl 5.10' => 3
- unless $] >= 5.010;
+ unless "$]" >= 5.010;
eval <<'EVALD';
my Tag $t3;
is $t3, $tid, "typed lexical correctly initialized in eval (propagated) at run $_ in thread $tid"
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;
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';
{ package IntX; package IntY; package IntZ; }
eval q!
my Int $y;
my $desc = 'pragma in use in eval in require';
- if ($] < 5.009005) {
+ if ("$]" < 5.009005) {
Test::More::is($y, undef, $desc);
} else {
Test::More::like($y, qr/^\(eval +\d+\):2$/, $desc);