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 @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';
}
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';
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;
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;
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';
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';
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";
}
);
sub import {
- if ($] >= 5.010001) {
+ if ("$]" >= 5.010001) {
push @blocks, [ 'given (1) {', '}' ];
require feature;
feature->import('switch');