XP is just a number | |
PerlMonks |
Re: return value from system call, exit status, shift right 8, bitwise and, $?by shawnhcorey (Friar) |
on Feb 11, 2010 at 14:15 UTC ( [id://822657]=note: print w/replies, xml ) | Need Help?? |
system() is one of those weird commands that do different things depending on their arguments. It you use a single string argument, the return status is the status of the shell (or CMD.EXE on Windows). Most often, this is zero (success) even if the shell could not find a program to run. If you use a list of arguments, then you get the return status of the program but none of the argument are interpoled. This may be a good thing or a bad thing, depending on what you expect. Example: a single string argument: my $status = system( "foobar arg1 arg2 arg3" ); $status contains the status of the shell or CMD.EXE. Example: a list of arguments: my $status = system( "foobar", "arg1", "arg2", "arg3" ); $status contains the status of foobar.
In Section
Seekers of Perl Wisdom
|
|