diff --git a/dist/I18N-Collate/t/I18N-Collate.t b/dist/I18N-Collate/t/I18N-Collate.t index 5916f5e4bd..b73b0e9ded 100644 --- a/dist/I18N-Collate/t/I18N-Collate.t +++ b/dist/I18N-Collate/t/I18N-Collate.t @@ -6,8 +6,8 @@ use strict; no warnings; +use Config; BEGIN { - require Config; Config->import; if (!$::Config{d_setlocale} || $::Config{ccflags} =~ /\bD?NO_LOCALE\b/) { print "1..0\n"; exit; diff --git a/dist/IO/t/io_linenum.t b/dist/IO/t/io_linenum.t index d315c37e0e..bad25c2214 100644 --- a/dist/IO/t/io_linenum.t +++ b/dist/IO/t/io_linenum.t @@ -7,8 +7,8 @@ my $File; BEGIN { $File = __FILE__; - require strict; strict->import(); } +use strict; use Test::More tests => 12; diff --git a/dist/Safe/t/safe1.t b/dist/Safe/t/safe1.t index e9bd5cf675..15602e65dc 100644 --- a/dist/Safe/t/safe1.t +++ b/dist/Safe/t/safe1.t @@ -1,7 +1,7 @@ #!./perl -w $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safe2.t b/dist/Safe/t/safe2.t index 2168084846..62cc163d2a 100644 --- a/dist/Safe/t/safe2.t +++ b/dist/Safe/t/safe2.t @@ -1,7 +1,7 @@ #!./perl -w $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safe3.t b/dist/Safe/t/safe3.t index fcca684ea9..b0094db9d9 100644 --- a/dist/Safe/t/safe3.t +++ b/dist/Safe/t/safe3.t @@ -1,7 +1,7 @@ #!perl -w +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'extensions'} !~ /\bPOSIX\b/ && $Config{'osname'} ne 'VMS') diff --git a/dist/Safe/t/safeload.t b/dist/Safe/t/safeload.t index f8cb75513e..fcdaa52dd4 100644 --- a/dist/Safe/t/safeload.t +++ b/dist/Safe/t/safeload.t @@ -1,8 +1,7 @@ #!perl +use Config; BEGIN { - require Config; - Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/) { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/saferegexp.t b/dist/Safe/t/saferegexp.t index 674495c71e..3ca6a98889 100644 --- a/dist/Safe/t/saferegexp.t +++ b/dist/Safe/t/saferegexp.t @@ -1,7 +1,7 @@ #!perl -w +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/) { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safesecurity.t b/dist/Safe/t/safesecurity.t index 17362a2862..0e0cdb8279 100644 --- a/dist/Safe/t/safesecurity.t +++ b/dist/Safe/t/safesecurity.t @@ -1,8 +1,7 @@ #!perl +use Config; BEGIN { - require Config; - Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/) { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safesig.t b/dist/Safe/t/safesig.t index 62c67ed641..a746480961 100644 --- a/dist/Safe/t/safesig.t +++ b/dist/Safe/t/safesig.t @@ -1,8 +1,7 @@ #!perl +use Config; BEGIN { - require Config; - Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/) { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safesort.t b/dist/Safe/t/safesort.t index 827ec5372f..78acb03d38 100644 --- a/dist/Safe/t/safesort.t +++ b/dist/Safe/t/safesort.t @@ -1,7 +1,7 @@ #!perl -w $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safeuniversal.t b/dist/Safe/t/safeuniversal.t index 587addb6bd..86de73b32e 100644 --- a/dist/Safe/t/safeuniversal.t +++ b/dist/Safe/t/safeuniversal.t @@ -1,8 +1,7 @@ #!perl +use Config; BEGIN { - require Config; - Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/) { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safeutf8.t b/dist/Safe/t/safeutf8.t index eec57a4a0f..cc34c27f95 100644 --- a/dist/Safe/t/safeutf8.t +++ b/dist/Safe/t/safeutf8.t @@ -1,7 +1,7 @@ #!perl -w $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safewrap.t b/dist/Safe/t/safewrap.t index c9d8b96828..98070ff3eb 100644 --- a/dist/Safe/t/safewrap.t +++ b/dist/Safe/t/safewrap.t @@ -1,8 +1,8 @@ #!perl -w $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t index 77128c4d17..5df93c02e4 100644 --- a/ext/Devel-Peek/t/Peek.t +++ b/ext/Devel-Peek/t/Peek.t @@ -1,7 +1,7 @@ #!./perl -T +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bDevel\/Peek\b/) { print "1..0 # Skip: Devel::Peek was not built\n"; exit 0; diff --git a/ext/Fcntl/t/syslfs.t b/ext/Fcntl/t/syslfs.t index bd9c7b21d3..e94b2dd4ae 100644 --- a/ext/Fcntl/t/syslfs.t +++ b/ext/Fcntl/t/syslfs.t @@ -2,15 +2,15 @@ # stdio: open(), tell(), seek(), print(), read() is tested in t/op/lfs.t. # If you modify/add tests here, remember to update also t/op/lfs.t. +use Config; BEGIN { - require Config; Config->import; # Don't bother if there are no quad offsets. if ($Config{lseeksize} < 8) { print "1..0 # Skip: no 64-bit file offsets\n"; exit(0); } - require Fcntl; Fcntl->import(qw(/^O_/ /^SEEK_/)); } +use Fcntl qw(/^O_/ /^SEEK_/); use strict; use File::Temp 'tempfile'; diff --git a/ext/IPC-Open3/t/IPC-Open3.t b/ext/IPC-Open3/t/IPC-Open3.t index a30f361e72..616e9e2f3a 100644 --- a/ext/IPC-Open3/t/IPC-Open3.t +++ b/ext/IPC-Open3/t/IPC-Open3.t @@ -1,7 +1,7 @@ #!./perl -w +use Config; BEGIN { - require Config; Config->import; if (!$Config{'d_fork'} # open2/3 supported on win32 && $^O ne 'MSWin32') diff --git a/ext/Opcode/t/Opcode.t b/ext/Opcode/t/Opcode.t index 1f43d8942d..5900d20ece 100644 --- a/ext/Opcode/t/Opcode.t +++ b/ext/Opcode/t/Opcode.t @@ -2,8 +2,8 @@ $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/ext/Opcode/t/ops.t b/ext/Opcode/t/ops.t index 0756414594..539cdc1449 100644 --- a/ext/Opcode/t/ops.t +++ b/ext/Opcode/t/ops.t @@ -1,7 +1,7 @@ #!./perl +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/ext/POSIX/t/mb.t b/ext/POSIX/t/mb.t index 2af5f855d4..260c32644d 100644 --- a/ext/POSIX/t/mb.t +++ b/ext/POSIX/t/mb.t @@ -7,8 +7,8 @@ # the Perl one. So we run the tests in a separate "fresh_perl" process # with the correct LC_CTYPE set in the environment. +use Config; BEGIN { - require Config; Config->import; if ($^O ne 'VMS' and $Config{'extensions'} !~ /\bPOSIX\b/) { print "1..0\n"; exit 0; diff --git a/ext/POSIX/t/posix.t b/ext/POSIX/t/posix.t index 059c63a284..999197aa91 100644 --- a/ext/POSIX/t/posix.t +++ b/ext/POSIX/t/posix.t @@ -1,7 +1,7 @@ #!./perl +use Config; BEGIN { - require Config; Config->import; if ($^O ne 'VMS' and $Config{'extensions'} !~ /\bPOSIX\b/) { print "1..0\n"; exit 0; diff --git a/ext/POSIX/t/taint.t b/ext/POSIX/t/taint.t index 00ca4ec16a..4facd0fdf4 100644 --- a/ext/POSIX/t/taint.t +++ b/ext/POSIX/t/taint.t @@ -1,7 +1,7 @@ #!./perl -Tw +use Config; BEGIN { - require Config; Config->import; if ($^O ne 'VMS' and $Config{'extensions'} !~ /\bPOSIX\b/) { print "1..0\n"; exit 0; diff --git a/ext/Sys-Hostname/t/Hostname.t b/ext/Sys-Hostname/t/Hostname.t index c40d1e161d..4ee672a081 100644 --- a/ext/Sys-Hostname/t/Hostname.t +++ b/ext/Sys-Hostname/t/Hostname.t @@ -1,7 +1,7 @@ #!./perl +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bSys\/Hostname\b/) { print "1..0 # Skip: Sys::Hostname was not built\n"; exit 0; diff --git a/ext/XS-APItest/t/my_cxt.t b/ext/XS-APItest/t/my_cxt.t index be03309e21..eb5f6335a4 100644 --- a/ext/XS-APItest/t/my_cxt.t +++ b/ext/XS-APItest/t/my_cxt.t @@ -4,8 +4,8 @@ # DAPM Dec 2005 my $threads; +use Config; BEGIN { - require Config; Config->import; $threads = $Config{'useithreads'}; # must 'use threads' before 'use Test::More' eval 'use threads' if $threads; diff --git a/ext/XS-Typemap/t/Typemap.t b/ext/XS-Typemap/t/Typemap.t index 7badbd8de3..e10355edbe 100644 --- a/ext/XS-Typemap/t/Typemap.t +++ b/ext/XS-Typemap/t/Typemap.t @@ -1,5 +1,5 @@ +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bXS\/Typemap\b/) { print "1..0 # Skip: XS::Typemap was not built\n"; exit 0; diff --git a/lib/AnyDBM_File.t b/lib/AnyDBM_File.t index 045fa45616..8d063ba320 100644 --- a/lib/AnyDBM_File.t +++ b/lib/AnyDBM_File.t @@ -3,10 +3,10 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require Config; Config->import; - require Test::More; Test::More->import; - plan(tests, 12); } +use Config; +use Test::More; +plan(tests, 12); require AnyDBM_File; use Fcntl; diff --git a/lib/Net/hostent.t b/lib/Net/hostent.t index dbe4a6b7e0..5a8bf31a2f 100644 --- a/lib/Net/hostent.t +++ b/lib/Net/hostent.t @@ -6,9 +6,9 @@ BEGIN { } use Test::More; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bSocket\b/ && !(($^O eq 'VMS') && $Config{d_socket})) { @@ -19,8 +19,6 @@ BEGIN { } } -use Test::More; - BEGIN { use_ok 'Net::hostent' } # Remind me to add this to Test::More. diff --git a/lib/locale.t b/lib/locale.t index 5a97de9ae6..f441d389cc 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -54,8 +54,8 @@ BEGIN { exit; } $| = 1; - require Config; Config->import; } +use Config; use feature 'fc'; my @langinfo; diff --git a/lib/open.t b/lib/open.t index 00a8a14495..6218c57efe 100644 --- a/lib/open.t +++ b/lib/open.t @@ -3,10 +3,10 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require Config; Config->import; require './test.pl'; require './charset_tools.pl'; } +use Config; plan 11; diff --git a/t/io/errnosig.t b/t/io/errnosig.t index 174e65684f..2e0b70378c 100644 --- a/t/io/errnosig.t +++ b/t/io/errnosig.t @@ -6,7 +6,7 @@ BEGIN { set_up_inc( qw(. ../lib) ); } -require Config; Config->import; +use Config; plan(tests => 1); SKIP: { diff --git a/t/io/pipe.t b/t/io/pipe.t index 91f4fba0c0..980de94a93 100644 --- a/t/io/pipe.t +++ b/t/io/pipe.t @@ -4,8 +4,8 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib'); - require Config; Config->import; } +use Config; if (!$Config{'d_fork'}) { skip_all("fork required to pipe"); } diff --git a/t/io/semctl.t b/t/io/semctl.t index 0b36f2c34b..2fdf4dfdda 100644 --- a/t/io/semctl.t +++ b/t/io/semctl.t @@ -3,8 +3,8 @@ BEGIN { @INC = '../lib' if -d '../lib' && -d '../ext'; require "./test.pl"; - require Config; Config->import; } +use Config; use strict; use warnings; diff --git a/t/lib/commonsense.t b/t/lib/commonsense.t index 7705fee24e..83d7f622a3 100644 --- a/t/lib/commonsense.t +++ b/t/lib/commonsense.t @@ -5,11 +5,10 @@ BEGIN { @INC = '../lib'; require './test.pl'; } +use Config; plan( tests => 1); -require Config; Config->import; - if (($Config{'extensions'} !~ /\bFcntl\b/) ){ BAIL_OUT("Perl configured without Fcntl module"); } diff --git a/t/op/lc.t b/t/op/lc.t index b0ecfb6c58..4cb2553bbb 100644 --- a/t/op/lc.t +++ b/t/op/lc.t @@ -9,7 +9,6 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib'); - require Config; Config->import; skip_all_without_unicode_tables(); require './charset_tools.pl'; require './loc_tools.pl'; # Contains find_utf8_ctype_locale() diff --git a/t/op/quotemeta.t b/t/op/quotemeta.t index 201c499291..9328e8e7d3 100644 --- a/t/op/quotemeta.t +++ b/t/op/quotemeta.t @@ -4,9 +4,9 @@ BEGIN { chdir 't' if -d 't'; require "./test.pl"; set_up_inc( qw(../lib .) ); - require Config; Config->import; require "./loc_tools.pl"; } +use Config; plan tests => 60; diff --git a/t/re/anyof.t b/t/re/anyof.t index de89115435..1f42e1353c 100644 --- a/t/re/anyof.t +++ b/t/re/anyof.t @@ -16,9 +16,9 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib','.','../ext/re'); - require Config; Config->import; skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader; } +use Config; # An array is used instead of a hash, so that the tests are carried out in the # order given by this file. Even-numbered indices are the regexes to compile. diff --git a/t/re/fold_grind.pl b/t/re/fold_grind.pl index 306b4d9cb7..2922b25dc5 100644 --- a/t/re/fold_grind.pl +++ b/t/re/fold_grind.pl @@ -12,7 +12,6 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib'); - require Config; Config->import; skip_all_if_miniperl("no dynamic loading on miniperl, no Encode nor POSIX"); if ($^O eq 'dec_osf') { skip_all("$^O cannot handle this test"); diff --git a/t/re/pat.t b/t/re/pat.t index 39ce47538c..2a707e7f0a 100644 --- a/t/re/pat.t +++ b/t/re/pat.t @@ -18,10 +18,10 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib', '.', '../ext/re'); - require Config; Config->import; require './charset_tools.pl'; require './loc_tools.pl'; } +use Config; skip_all_without_unicode_tables(); diff --git a/t/re/speed.t b/t/re/speed.t index 637a549c2a..b61009c3b4 100644 --- a/t/re/speed.t +++ b/t/re/speed.t @@ -18,8 +18,8 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib','.','../ext/re'); - require Config; Config->import; } +use Config; skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader; skip_all_without_unicode_tables(); diff --git a/t/re/stclass_threads.t b/t/re/stclass_threads.t index afe46b6ddb..b593758cb1 100644 --- a/t/re/stclass_threads.t +++ b/t/re/stclass_threads.t @@ -15,7 +15,6 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib', '.', '../ext/re'); - require Config; Config->import; } skip_all_without_config('useithreads'); diff --git a/t/re/subst.t b/t/re/subst.t index 8cf3e02e73..6035b260e7 100644 --- a/t/re/subst.t +++ b/t/re/subst.t @@ -4,12 +4,11 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib'); - require Config; Config->import; - require constant; - constant->import(constcow => *Config::{NAME}); require './charset_tools.pl'; require './loc_tools.pl'; } +use Config; +use constant constcow => *Config::{NAME}; plan(tests => 281); diff --git a/t/run/runenv_hashseed.t b/t/run/runenv_hashseed.t index 75d4af847a..67bb49162c 100644 --- a/t/run/runenv_hashseed.t +++ b/t/run/runenv_hashseed.t @@ -45,9 +45,8 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; - require Config; - Config->import; } +use Config; skip_all_without_config('d_fork'); skip_all("NO_PERL_HASH_ENV or NO_PERL_HASH_SEED_DEBUG set") diff --git a/t/run/runenv_randseed.t b/t/run/runenv_randseed.t index bdcf20269c..49698e7b9a 100644 --- a/t/run/runenv_randseed.t +++ b/t/run/runenv_randseed.t @@ -4,9 +4,8 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; - require Config; - Config->import; } +use Config; skip_all_without_config('d_fork'); skip_all("This perl is built with NO_PERL_RAND_SEED") diff --git a/t/run/switchM.t b/t/run/switchM.t index 5944669883..55dbf2b3a8 100644 --- a/t/run/switchM.t +++ b/t/run/switchM.t @@ -3,10 +3,8 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require Config; - Config->import; - } +use Config; use strict; use warnings; diff --git a/t/run/switches.t b/t/run/switches.t index 210089bb0f..bf440e1a13 100644 --- a/t/run/switches.t +++ b/t/run/switches.t @@ -7,11 +7,10 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require Config; Config->import; + require "./test.pl"; + require "./loc_tools.pl"; } -BEGIN { require "./test.pl"; require "./loc_tools.pl"; } - use Config; # due to a bug in VMS's piping which makes it impossible for runperl() diff --git a/t/run/todo.t b/t/run/todo.t index fc963e9ac5..939916d061 100644 --- a/t/run/todo.t +++ b/t/run/todo.t @@ -5,8 +5,8 @@ BEGIN { set_up_inc('../lib', '.', '../ext/re'); require './charset_tools.pl'; require './loc_tools.pl'; - require Config; Config->import; } +use Config; use strict; use warnings; diff --git a/t/uni/fold.t b/t/uni/fold.t index f919c78ef7..e03b5f4a0a 100644 --- a/t/uni/fold.t +++ b/t/uni/fold.t @@ -10,7 +10,6 @@ BEGIN { set_up_inc('../lib'); skip_all_without_unicode_tables(); skip_all_if_miniperl("miniperl, no Unicode::Normalize"); - require Config; Config->import; require './charset_tools.pl'; require './loc_tools.pl'; # Contains find_utf8_ctype_locale() } diff --git a/t/uni/overload.t b/t/uni/overload.t index f126fa3627..6fc153d571 100644 --- a/t/uni/overload.t +++ b/t/uni/overload.t @@ -4,7 +4,6 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc( '../lib' ); - require Config; Config->import; require './charset_tools.pl'; require './loc_tools.pl'; } diff --git a/t/win32/runenv.t b/t/win32/runenv.t index d9384057d7..04bede1b92 100644 --- a/t/win32/runenv.t +++ b/t/win32/runenv.t @@ -8,8 +8,6 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require Config; Config->import; - require File::Temp; File::Temp->import(qw/:POSIX/); require Win32; ($::os_id, $::os_major) = ( Win32::GetOSVersion() )[ 4, 1 ]; @@ -22,6 +20,8 @@ BEGIN { require './test.pl'; } +use Config; +use File::Temp qw/:POSIX/; skip_all "requires compilation with PERL_IMPLICIT_SYS" unless $Config{ccflags} =~/(?:\A|\s)-DPERL_IMPLICIT_SYS\b/;