diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-07 22:27:46 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-07 22:27:46 +0000 |
commit | 8db06b029e74a387acf2b185d9e9e393795b9dfe (patch) | |
tree | e0ee0ada9d995ec1b9a53be07a08474c44e15893 /t/test.pl | |
parent | 17a740d51341832c6dd611e5bea020e58a1c5a93 (diff) | |
download | perl-8db06b029e74a387acf2b185d9e9e393795b9dfe.tar.gz |
which_perl: if File::Spec fails, assume "./" and hope for the best.
p4raw-id: //depot/perl@13526
Diffstat (limited to 't/test.pl')
-rw-r--r-- | t/test.pl | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |