An old bug could cause $] to be initialized to a wrong decimal value.
Since its stringified value was always right, we use it instead.
meh $y;
####
meh $y, 1, 2;
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
meh $z;
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
meh $z, 1, 2;
####
print;
print $y;
####
print $y "dongs\n";
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
print $z;
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
print $z "hlagh\n";
####
print STDOUT "bananananananana\n";
SKIP:
{
skip 'No space tests on perl 5.11' => 4 + @expected
- if $] >= 5.011 and $] < 5.012;
+ if "$]" >= 5.011 and "$]" < 5.012;
my $code = $code;
$code =~ s/\$/\$ \n\t /g;
meh $y, 1, 2;
----
[ 'meh', '$y' ]
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
meh $z;
----
[ 'meh', '$z' ]
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
meh $z 1, 2;
----
[ 'meh', '$z' ]
-#### $] < 5.010 # use feature 'state'; state $z
+#### "$]" < 5.010 # use feature 'state'; state $z
meh $z, 1, 2;
----
[ 'meh', '$z' ]
}
}
is $@, '', "no indirect; eval 'my \$x = new Bar'";
- if ($] < 5.009005) {
+ if ("$]" < 5.009005) {
is @w, 0, 'no warnings caught';
pass 'placeholder';
} else {
SKIP: {
skip 'The pragma doesn\'t propagte into eval STRING before perl 5.10' => 2
- if $] < 5.009005;
+ if "$]" < 5.009005;
my @w;
my $test = sub { eval 'return; new XYZ' };
{
eval "return; no indirect; use indirect::TestRequired2; my \$x = new Bar;";
}
is $@, '', 'second require test doesn\'t croak prematurely';
- @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;
my $w = shift @w;
like $w, expect('Baz', 't/lib/indirect/TestRequired2.pm'),
'second require test caught error for Baz';
SKIP: {
skip 'The pragma doesn\'t propagte into eval STRING before perl 5.10' => 1
- if $] < 5.009005;
+ if "$]" < 5.009005;
$w = shift @w;
like $w, expect('Blech'), 'second require test caught error for Blech';
}
new indirect::TestRequired3Z;
}
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 $@, '',
"pragma leak when reusing callback test doesn't croak prematurely";
is_deeply \@w, [ ],
SKIP: {
skip 'This would require extensive work to be okay with perl 5.8' => 1
- if $] < 5.010;
+ if "$]" < 5.010;
local %^H = (a => 1);
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;
my $class = "Pineapple$tid";
my @warns;
{
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';
my ($code, @expected);
SKIP:
{
- skip 'Fixed in core only since 5.12' => 1 unless $] >= 5.012;
+ skip 'Fixed in core only since 5.12' => 1 unless "$]" >= 5.012;
my $status = run_perl 'no indirect hook => sub { exit 2 }; new X';
is $status, 2 << 8, 'no semicolon at the end of -e';
}