]> git.vpit.fr Git - perl/modules/Lexical-Types.git/commitdiff
Replace $] by "$]"
authorVincent Pit <vince@profvince.com>
Wed, 24 Aug 2011 16:09:48 +0000 (18:09 +0200)
committerVincent Pit <vince@profvince.com>
Wed, 24 Aug 2011 16:09:48 +0000 (18:09 +0200)
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 $].

Makefile.PL
t/11-args.t
t/13-padsv.t
t/14-ro.t
t/16-scope.t
t/30-threads.t
t/31-threads-teardown.t
t/lib/Lexical/Types/TestRequired2.pm

index 1e126e8d6be53f49abda979c671faec0d829a8a1..ee097e2f9b74dbe05406ec787e797a1f005d0789 100644 (file)
@@ -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
 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
  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';
 }
 
  push @DEFINES, '-DLT_FORKSAFE=0';
 }
 
index 695d6c9ad04e895af97886b55a72a35c3546245f..a1018905af479f52071db03dff4b5c8e74eb4bdd 100644 (file)
@@ -96,7 +96,7 @@ use Test::More tests => 14 + 6;
 
 {
  my $expect = qr/^Lexical::Types mangler should return zero, one or two scalars, but got 3/;
 
 {
  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> };
  local $@;
  eval q[
   use Lexical::Types as => sub { qw<a b c> };
@@ -117,7 +117,7 @@ use Test::More tests => 14 + 6;
 
 {
  my $expect = qr/^banana at \(eval \d+\) line 2/;
 
 {
  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' };
  local $@;
  eval q[
   use Lexical::Types as => sub { die 'banana' };
index 0509260d821f246df2c8770abec9b0b86e37851d..ab042aee6968be0964360d462b7c5687b6f58d70 100644 (file)
@@ -34,7 +34,7 @@ sub Int::TYPEDSCALAR { push @lines, (caller(0))[2]; () }
 
 SKIP: {
  skip 'Broken with threaded perls before 5.8.4' => 1
 
 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
 
  use Lexical::Types as => sub {
   # In 5.10, this closure is compiled before hints are enabled, so no hintseval
index c8e9f7d5b33c5d8655467e741f19c89145e37534..bae8ccf079920b9774c1c57edbf491ac3c002061 100644 (file)
--- a/t/14-ro.t
+++ b/t/14-ro.t
@@ -24,7 +24,7 @@ sub ro_re {
 }
 
 sub maybe_warn {
 }
 
 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;
 }
 
 {
 }
 
 {
@@ -38,7 +38,7 @@ sub maybe_warn {
 }
 
 SKIP: {
 }
 
 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!
  maybe_warn();
  local $@;
  eval q!
index 08fabbb329654a60be4ace30baca5f23c458c4f4..9e858dcfee4500d8e8b5f25d0047d913640b7b40 100644 (file)
@@ -39,7 +39,7 @@ use lib 't/lib';
    ::is($z, __FILE__.':6', 'pragma in use at the end');
   }
  TESTREQUIRED3
    ::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> ],
  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> ],
index d48fa023032c4b5607433e873c464a307d0e4961..c616b76ecf65a3804a3de55cb5461c87a30ac331 100644 (file)
@@ -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'
  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;
 }
 
 use threads;
@@ -67,7 +67,7 @@ EVALD
 SKIP:
   {
    skip 'Hints aren\'t propagated into eval STRING below perl 5.10' => 3
 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"
    eval <<'EVALD';
     my Tag $t3;
     is $t3, $tid, "typed lexical correctly initialized in eval (propagated) at run $_ in thread $tid"
index cd93a505d342512c105a952b0e93904a7e1f8442..34e61acd2a75543af35eed20019f57a7c78a932c 100644 (file)
@@ -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'
  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;
 }
 
 use threads;
@@ -43,7 +43,7 @@ sub run_perl {
 
 SKIP:
 {
 
 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; }
 
  my $status = run_perl <<' RUN';
   { package IntX; package IntY; package IntZ; }
index eb15065f1aaa1a60820ce3782762610030beada6..52370715b776f58ee07d94e05e13c609ea4be70b 100644 (file)
@@ -15,7 +15,7 @@ Test::More::is($x, 't/lib/Lexical/Types/TestRequired2.pm:' . (__LINE__-1), 'prag
 eval q!
  my Int $y;
  my $desc = 'pragma in use in eval in require';
 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);
   Test::More::is($y, undef, $desc);
  } else {
   Test::More::like($y, qr/^\(eval +\d+\):2$/, $desc);