in reply to [Win32] Successful system() call returns 256
Try running the command from the command line and displaying what windows sees as the exit code before perl gets it hands on it:
c:\test\xx>diff junk5.png junk6.png >nul & echo %errorlevel% 0 c:\test\xx>diff junk5.png junk4.png >nul & echo %errorlevel% 1
The likely cause is that whilst Windows exit codes are ints, Perl internally truncates them to 8-bits before concatenating it with other bits that are meant to emulate child termination reasoning per the system docs:
If you'd like to manually inspect system's failure, you can check all +possible failure modes by inspecting $? like this: if ($? == -1) { print "failed to execute: $!\n"; } elsif ($? & 127) { printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; } else { printf "child exited with value %d\n", $? >> 8; }
|
|---|