The stupid question is the question not asked | |
PerlMonks |
return values with system()by jason (Initiate) |
on Feb 13, 2007 at 16:46 UTC ( [id://599717]=perlquestion: print w/replies, xml ) | Need Help?? |
jason has asked for the wisdom of the Perl Monks concerning the following question:
hi, I'm running a unix program through perl using the system command. I want to be able to get the return value of the program and use it within my perl code. Is there a way to do this. Right now the return values I get from the system command are always 0 even though my application exits with an ERROR. When I run the application locally it sets the environment variable $status to 4. This is what I'm interested in for my program. i.e. can I do something like this: system($cmd;echo $status); but instead of echoing status get the return value in my program? Thanks!
Back to
Seekers of Perl Wisdom
|
|