}
use Config;
+require './test.pl'; # for runperl()
print "1..187\n";
close READ2;
open STDOUT, ">&WRITE" or die "Can't redirect STDOUT: $!";
open STDERR, ">&WRITE2" or die "Can't redirect STDERR: $!";
- exec './perl', '-w', '-'
- or die "Can't exec ./perl: $!";
+ exec which_perl(), '-w', '-'
+ or die "Can't exec perl: $!";
} else {
# Parent process here.
close WRITE;
my $errfile = "terr$$"; $errfile++ while -e $errfile;
my @tmpfiles = ($cmdfile, $errfile);
open CMD, ">$cmdfile"; print CMD $code; close CMD;
- my $cmd = (($^O eq 'VMS') ? "$^X"
- : ($^O eq 'MSWin32') ? '.\perl'
- : ($^O eq 'MacOS') ? $^X
- : ($^O eq 'NetWare') ? 'perl'
- : './perl');
+ my $cmd = which_perl();
$cmd .= " -w $cmdfile 2>$errfile";
if ($^O eq 'VMS' or $^O eq 'MSWin32' or $^O eq 'NetWare') {
# Use pipe instead of system so we don't inherit STD* from
test { $a{7}->()->() + $a{11}->()->() == 18 };
}
-require './test.pl'; # for runperl()
-
{
# bugid #23265 - this used to coredump during destruction of PL_maincv
# and its children
$Is_miniperl = $ENV{PERL_CORE_MINITEST};
$Is_BeOS = $^O eq 'beos';
-$PERL = ($Is_NetWare ? 'perl' :
- ($Is_MacOS || $Is_VMS) ? $^X :
- $Is_MSWin32 ? '.\perl' :
- './perl');
+$PERL = $ENV{PERL}
+ || ($Is_NetWare ? 'perl' :
+ ($Is_MacOS || $Is_VMS) ? $^X :
+ $Is_MSWin32 ? '.\perl' :
+ './perl');
eval '$ENV{"FOO"} = "hi there";'; # check that ENV is inited inside eval
# cmd.exe will echo 'variable=value' but 4nt will echo just the value