我是xampp的新手,而且我也是Perl编程的新手。 我只是试图打开文件C:\ xampp \ cgi-bin \ printenv.pl,我犯了一个错误。在记事本中打开的.pl文件
我选择了默认程序来打开该文件扩展名为记事本,选项always use the selected program to open this kind of file
。
现在,当我尝试从cmd运行.pl文件时,它将在记事本中打开它们而不是执行。请回复。提前致谢。在shell提示下
我是xampp的新手,而且我也是Perl编程的新手。 我只是试图打开文件C:\ xampp \ cgi-bin \ printenv.pl,我犯了一个错误。在记事本中打开的.pl文件
我选择了默认程序来打开该文件扩展名为记事本,选项always use the selected program to open this kind of file
。
现在,当我尝试从cmd运行.pl文件时,它将在记事本中打开它们而不是执行。请回复。提前致谢。在shell提示下
键入以下内容:
assoc .pl=PerlScript
ftype PerlScript="c:\...\bin\perl.exe" "%1" %*
(更换...
用正确的路径)
池上的建议并没有在Windows 10为我工作,但在发现杰克·吴的评论后, ActivePerl. .pl files no longer execute but open in Notepad instead我能解决这个问题这样:
Perl5.16.3.exe
(或等价,这取决于哪个版本的Perl已安装:但不Perl.exe
)然后Perl的图标出现在.pl文件旁边,并且按需双击会导致它们每次都以Perl打开。
尝试使用pl2bat或它的一些现代变化(我没有用过很长时间的窗户,所以我不知道)。重点是将.pl转换成.bat文件,该文件通常看起来像'@C:\ path \ to \ perl \ nexit \ n#!/ usr/bin/perl -x'。 -x表示“在##perl行之前忽略任何内容” –
Dallaylaen
[我如何让Perl脚本像Windows上的普通程序一样运行?](http://stackoverflow.com/questions/4727480/how-do-i -make-MY-的Perl脚本幕般正常的程序,在窗口) – daxim