211 |
$iswin32 = $^O eq "MSWin32"; |
$iswin32 = $^O eq "MSWin32"; |
212 |
} |
} |
213 |
|
|
214 |
|
my @tmps = (); |
215 |
if ($iswin32) { |
if ($iswin32) { |
216 |
eval("use Win32;"); |
eval("use Win32;"); |
217 |
$Test::Cmd::_WIN32 = 1; |
$Test::Cmd::_WIN32 = 1; |
218 |
$Test::Cmd::Temp_Prefix = "~testcmd$$-"; |
$Test::Cmd::Temp_Prefix = "~testcmd$$-"; |
219 |
$Test::Cmd::Cwd_Ref = \&Win32::GetCwd; |
# Test for WIN32 temporary directories. |
220 |
if (! $Test::Cmd::TMPDIR) { |
# The following is lifted from the 5.005056 |
221 |
# Test for WIN32 temporary directories. |
# version of File::Spec::Win32::tmpdir. |
222 |
# The following is lifted from the 5.005056 |
push @tmps, @ENV{qw(TMPDIR TEMP TMP)}, qw(/tmp /) |
|
# version of File::Spec::Win32::tmpdir. |
|
|
foreach (@ENV{qw(TMPDIR TEMP TMP)}, qw(/tmp /)) { |
|
|
next unless defined && -d; |
|
|
$Test::Cmd::TMPDIR = $_; |
|
|
last; |
|
|
} |
|
|
} |
|
223 |
} else { |
} else { |
224 |
$Test::Cmd::Temp_Prefix = "testcmd$$."; |
$Test::Cmd::Temp_Prefix = "testcmd$$."; |
225 |
$Test::Cmd::Cwd_Ref = \&Cwd::cwd; |
# Test for UNIX temporary directories. |
226 |
if (! $Test::Cmd::TMPDIR) { |
# The following is lifted from the 5.005056 |
227 |
# Test for UNIX temporary directories. |
# version of File::Spec::Unix::tmpdir. |
228 |
# The following is lifted from the 5.005056 |
push @tmps, $ENV{TMPDIR}, "/tmp"; |
229 |
# version of File::Spec::Unix::tmpdir. |
} |
230 |
foreach ($ENV{TMPDIR}, "/tmp") { |
|
231 |
next unless defined && -d && -w _; |
$Test::Cmd::Cwd_Ref = \&Cwd::cwd; |
232 |
$Test::Cmd::TMPDIR = $_; |
if (! $Test::Cmd::TMPDIR) { |
233 |
last; |
foreach (@tmps) { |
234 |
} |
next unless defined && -d && -w _; |
235 |
|
$Test::Cmd::TMPDIR = $_; |
236 |
|
last; |
237 |
} |
} |
238 |
} |
} |
239 |
|
|
987 |
# print STDERR "Expect: $re\n"; |
# print STDERR "Expect: $re\n"; |
988 |
# print STDERR "Got: $l\n"; |
# print STDERR "Got: $l\n"; |
989 |
#} |
#} |
990 |
|
next if $l eq $re; # For exact text matches. |
991 |
return undef if $l !~ m/^$re$/; |
return undef if $l !~ m/^$re$/; |
992 |
} |
} |
993 |
return 1; |
return 1; |