windows 这个“无法打开 perl 脚本:没有这样的文件或目录”的原因是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5865867/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the reason for this "Can't open perl script : No such file or directory"
提问by Sagar Gupta M.
If I run this command in cygwin
(on windows xp platform)
如果我在cygwin
(在 windows xp 平台上)运行此命令
perl /cygdrive/c/Sagar/New_ISP/isp_fw_11_24_Test_V1/Scripts/w
indows_test_report_tool/testdbmerge.pl
I get this error:
我收到此错误:
Can't open perl script "/cygdrive/c/Sagar/New_ISP/isp_fw_11_24_Test_V1/Scripts/w
indows_test_report_tool/testdbmerge.pl": No such file or directory.
Why is this?
为什么是这样?
回答by ysth
Make sure that the first perl on your path is the cygwin perl; if it is a native Win32 perl (ActiveState or Strawberry, for instance), it won't understand cygwin paths.
确保路径上的第一个 perl 是 cygwin perl;如果它是本机 Win32 perl(例如 ActiveState 或 Strawberry),它将无法理解 cygwin 路径。
perl -V:osname
should report cygwin, not MSWin32.
perl -V:osname
应该报告 cygwin,而不是 MSWin32。