Perl - 没有这样的文件或目录执行错误。文件存在并且正在正确调用(Windows)
-
26-12-2019 - |
题
我有以下内容 exec
陈述:
$script_dir = 'C:\Users\mcnall\Documents\main_home\script';
exec("$script_dir\\exec.pl", "$name", "$func_type", "$func_args");
当到达这一行时,错误
Can't exec "C:\Users\mcnall\Documents\main_home\script\exec.pl": No such file or directory at C:\Users\mcnall\Documents\main_home\script\main.pl line 153.
文件 确实 存在。当我复制并粘贴时 C:\Users\mcnall\Documents\main_home\script\exec.pl
从上面的错误来看,它按预期运行文件,但由于某种原因,它不会通过脚本运行它。
我 必须 做了一些愚蠢的事情,有人可以告诉我我做错了什么吗?
解决方案
作为 mpapec
评论中建议,您需要指定 perl.exe
作为你的第一个论点:
exec("C:\\Perl\\bin\\perl.exe", "$script_dir\\exec.pl", ....... );
不隶属于 StackOverflow