system("logscr.ply ");
The error I get is this:
Can't exec "logscr.ply": Permission denied at e开发者_JS百科al.ply line 3
Why am I getting the error, and how do I fix it?
Without knowing any more details, there could be a variety of reasons:
- Your example code states you're trying to execute "logscr.ply ". The space character at the end might be parsed as part of the file name. This should yield a file-not-found error, though.
- The protection bits for the called script might not allow for direct execution. Try
chmod u+x logscr.ply
from your command prompt. - The folder containing logscr.ply might not be accessible to you. Make sure you have both read and execute permission on it (try
chmod u+r,u+x folder-name
). - The called script might not recognize itself as a Perl script, try
system("perl logscr.ply");
. - There might be a file with the same name somewhere earlier in your $PATH. Use absolute paths in your call to prevent this (
system("perl /some/path/logscr.ply");
), don't rely on your $PATH variable.
What platform/OS is this?
Probably logscr.ply
just does not have execute permissions set. On Linux/Unix e.g. you should do
chmod u+x logscr.ply
then try again.
Note: This assumes you are the owner of logscr.ply
. If not, adjust accordingly.
精彩评论