P is for Practical | |
PerlMonks |
Re^3: usage of $? in windowsby ikegami (Patriarch) |
on Mar 04, 2010 at 23:32 UTC ( [id://826840]=note: print w/replies, xml ) | Need Help?? |
$? == 256 means the child called exit(1) (256>>8 = 1). Chances are that the value (1) is not significant beyond meaning an error occurred. You'd think it would have emitted a message to STDERR identifying the error.
One likely cause is improper escaping of arguments. Print out $cmd, check for bad quoting, and try that same command at the prompt.
You mentioned the child is some kind of searching utility. An error could also indicate no matches were found.
The program's man page might identify situations where it might return an error.
In Section
Seekers of Perl Wisdom
|
|