This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move the loading of %Config from ReTest.pl to the only use point in pat.t
authorNicholas Clark <nick@ccl4.org>
Sat, 5 Mar 2011 10:07:01 +0000 (10:07 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 5 Mar 2011 20:26:10 +0000 (20:26 +0000)
t/re/ReTest.pl
t/re/pat.t

index 1b27e42..72316cc 100644 (file)
@@ -20,9 +20,6 @@ our $ordA = ord ('A');  # This defines ASCII/UTF-8 vs EBCDIC/UTF-EBCDIC
 our $IS_ASCII  = $ordA ==  65;
 our $IS_EBCDIC = $ordA == 193;
 
-use vars '%Config';
-eval 'use Config';          #  Defaults assumed if this fails
-
 require './test.pl';
 
 sub eval_ok ($;$) {
index 73c7cc1..a37764b 100644 (file)
@@ -10,7 +10,6 @@ use strict;
 use warnings;
 use 5.010;
 
-
 sub run_tests;
 
 $| = 1;
@@ -22,7 +21,6 @@ BEGIN {
     do "re/ReTest.pl" or die $@;
 }
 
-
 plan tests => 426;  # Update this when adding/deleting tests.
 
 run_tests() unless caller;
@@ -299,7 +297,10 @@ sub run_tests {
     {
         my $message = "REG_INFTY tests";
         # Tests which depend on REG_INFTY
-        $::reg_infty   = $Config {reg_infty} // 32767;
+
+       #  Defaults assumed if this fails
+       eval { require Config; };
+        $::reg_infty   = $Config::Config{reg_infty} // 32767;
         $::reg_infty_m = $::reg_infty - 1;
         $::reg_infty_p = $::reg_infty + 1;
         $::reg_infty_m = $::reg_infty_m;   # Suppress warning.