Am 2014-05-03 04:42:35, CHORNY schrieb:
Show quoted text
The problem in IPC/Run3.pm is this (paraphrasing a bit):
my $r = system @$cmd;
if (
defined $r
&& ( $r == -1 || ( is_win32 && $r == 0xFF00 ) )
&& !$options->{return_if_system_error}
) {
croak( $! );
}
It's the Windows-only check $r == 0xFF00 (i.e. 255<<8 ).
It's supposed to signal a problem in spawning the command,
cf.
http://search.cpan.org/~rjbs/perl-5.18.1/pod/perlport.pod#system
Unfortunately this makes it undistinguishable from the case where
the command runs, but returns status 255, as is the case when it die's.
E.g. on Windows, using Strawberry 5.18.1:
$ perl -E "my $r = system $^X, '-e', 'die'; say qq[\$r=$r \$?=$? \$!=$!]"
Died at -e line 1.
$r=65280 $?=65280 $!=
Actually, the documentation seems to be out of date:
$ perl -E "my $r = system 'frobozz'; say qq[\$r=$r \$?=$? \$!=$!]"
Der Befehl "frobozz" ist entweder falsch geschrieben oder konnte nicht gefunden werden.
$r=256 $?=256 $!=No such file or directory
So system() returns neither the general result (-1) for this error,
nor the Windows-specific one (255<<8).
BTW, the "Inappropriate I/O control operation" in the bug report is a red herring:
this $! was encountered long before system() was called (most likely in File::Temp::temfile()), but you're only allowed to look at $! if a function
actually reports an error.
Cheers, Roderich