From: Vincent Pit Date: Sun, 23 Oct 2011 14:55:07 +0000 (+0200) Subject: Preserve the PATH environment variable when running a sub-perl on cygwin X-Git-Tag: v0.47~22 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=commitdiff_plain;h=3e2559bcd9ca00ce63c1d5b8d05defbdb9b71e7a Preserve the PATH environment variable when running a sub-perl on cygwin --- diff --git a/t/17-ctl.t b/t/17-ctl.t index ca22761..31bab66 100644 --- a/t/17-ctl.t +++ b/t/17-ctl.t @@ -216,9 +216,10 @@ like $@, expect('tomato', undef, "\nBEGIN.*"), sub run_perl { my $code = shift; - my $SystemRoot = $ENV{SystemRoot}; + my ($SystemRoot, $PATH) = @ENV{qw}; local %ENV; $ENV{SystemRoot} = $SystemRoot if $^O eq 'MSWin32' and defined $SystemRoot; + $ENV{PATH} = $PATH if $^O eq 'cygwin' and defined $PATH; system { $^X } $^X, '-T', map("-I$_", @INC), '-e', $code; }