laziness, impatience, and hubris | |
PerlMonks |
Re: "System" will not run an executableby serf (Chaplain) |
on Dec 04, 2005 at 03:30 UTC ( [id://513898]=note: print w/replies, xml ) | Need Help?? |
Firstly find the program that you're running and provide the full path to it.
If you're in +n.x you can find this with:
let's say it tells you it's in /usr/local/bin/nzbget you would modify your code to be: The $! is *very* useful to help you here because it will tell you the system error that is being thrown to tell you why the command is failing. The ($?) will show you the return code that the program failed with (in case there was nothing useful in $!). Watch out for the fact that system is a little different from other functions that you expect to return 1 on success such as open: If you read system you will see that this is based around the fact that a program exiting successfully normally returns 0 (and system() does special magic on the return code to give you more useful info wrapped up in one number)
In Section
Seekers of Perl Wisdom
|
|