![]() |
|
go ahead... be a heretic | |
PerlMonks |
Re: Obtaining a return codeby bdimych (Monk) |
on Dec 10, 2007 at 15:25 UTC ( #656141=note: print w/replies, xml ) | Need Help?? |
From perldoc -f system:
You can check all the failure possibilities 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; } See also: $?andPOSIX system
In Section
Seekers of Perl Wisdom
|
|