From: Jerry D. Hedden Date: Tue, 23 Sep 2008 09:40:27 +0000 (-0400) Subject: Loading modules in test.pl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bb07982c124f18c3f2fabd8491bf0aecf9cbf009;p=p5sagit%2Fp5-mst-13.2.git Loading modules in test.pl From: "Jerry D. Hedden" Message-ID: <1ff86f510809230640y2d5a072g6abff6604f9daa79@mail.gmail.com> p4raw-id: //depot/perl@34434 --- diff --git a/t/test.pl b/t/test.pl index f44e43c..2f685cc 100644 --- a/t/test.pl +++ b/t/test.pl @@ -527,8 +527,7 @@ sub runperl { # run a fresh perl, so we'll brute force launder everything for you my $sep; - eval "require Config; Config->import"; - if ($@) { + if (! eval 'use Config; 1') { warn "test.pl had problems loading Config: $@"; $sep = ':'; } else { @@ -573,8 +572,7 @@ sub which_perl { return $Perl if $^O eq 'VMS'; my $exe; - eval "require Config; Config->import"; - if ($@) { + if (! eval 'use Config; 1') { warn "test.pl had problems loading Config: $@"; $exe = ''; } else { @@ -588,8 +586,7 @@ sub which_perl { if ($Perl =~ /^perl\Q$exe\E$/i) { my $perl = "perl$exe"; - eval "require File::Spec"; - if ($@) { + if (! eval 'use File::Spec; 1') { warn "test.pl had problems loading File::Spec: $@"; $Perl = "./$perl"; } else { @@ -903,7 +900,7 @@ sub watchdog ($) # Use a watchdog thread because either 'threads' is loaded, # or fork() failed - if (eval { require threads; }) { + if (eval 'use threads; 1') { threads->create(sub { # Load POSIX if available eval { require POSIX; };