|parrotcode: Run OS commands and tell about the exit code|
|Contents | Tests|
t/op/spawnw.t - Run OS commands and tell about the exit code
% perl -Ilib t/op/spawnw.t
Tests spawning external commands.
spawnw does not capture STDOUT and STDERR from the spawned command. So only the exit code can be tested.
The returned value is actually returned from the 'waitpid' system call. In order to get the exit code from the spawned process, it needs to be right shifted by 8 bit.
Test negative return codes.
The special variable $? in Perl5.
Nigel Sandever - email@example.com