From: Jarkko Hietaniemi Date: Fri, 7 Dec 2001 22:27:46 +0000 (+0000) Subject: which_perl: if File::Spec fails, assume "./" and hope for the best. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8db06b029e74a387acf2b185d9e9e393795b9dfe;p=p5sagit%2Fp5-mst-13.2.git which_perl: if File::Spec fails, assume "./" and hope for the best. p4raw-id: //depot/perl@13526 --- diff --git a/t/test.pl b/t/test.pl index c276fb3..5a81d54 100644 --- a/t/test.pl +++ b/t/test.pl @@ -289,15 +289,17 @@ sub which_perl { # which is a bit heavyweight to do here. if ($Perl =~ /^perl\Q$exe\E$/i) { + my $perl = "perl$exe"; eval "require File::Spec"; if ($@) { warn "test.pl had problems loading File::Spec: $@"; + $Perl = "./$perl"; } else { - $Perl = File::Spec->catfile(File::Spec->curdir(), "perl$exe"); + $Perl = File::Spec->catfile(File::Spec->curdir(), $perl); } } - warn "which_perl: cannot find perl from $^X" unless -f $Perl; + warn "which_perl: cannot find $Perl from $^X" unless -f $Perl; # For subcommands to use. $ENV{PERLEXE} = $Perl;