[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
[PATCH] Loading modules in test.pl
The attached patch simplifies the module loading checks in t/test.pl
by using the " eval 'use Module; 1' " construct.
--- perl-current/t/test.pl
+++ perl-current/t/test.pl
@@ -527,8 +527,7 @@
# 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 @@
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 @@
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 @@
# 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; };
- Follow-Ups from:
-
"Rafael Garcia-Suarez" <rgarciasuarez@gmail.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]