in reply to DNScmd in perl script
Technically to only test the status code you should use:
The lower eight bits of $? contain the signal that terminated the process.if ($? >> 8) { print "Error " }
There's more info in the perldoc POSIX documentation. In particular, see the documentation for the functions WEXITSTATUS and WIFEXITED.
Note that you shouldn't always trust the status code since it is possible for the command to terminate (like via a signal) before it has a chance to set it.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: DNScmd in perl script
by ikegami (Patriarch) on Jul 29, 2008 at 08:15 UTC | |
Re^2: DNScmd in perl script
by ajd335 (Novice) on Jul 28, 2008 at 21:23 UTC | |
by pc88mxer (Vicar) on Jul 28, 2008 at 21:29 UTC | |
by ajd335 (Novice) on Jul 28, 2008 at 21:59 UTC |
In Section
Seekers of Perl Wisdom