ActivePerl。 .pl文件不再执行,而是在记事本中打开 [英] ActivePerl. .pl files no longer execute but open in Notepad instead

查看:183
本文介绍了ActivePerl。 .pl文件不再执行,而是在记事本中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我有在Windows 7中运行的perl脚本。我错误地使用NotePad作为打开/编辑.pl文件的默认设置。现在,当我尝试从DOS提示符下运行未编辑的.pl文件时,该脚本不会执行,而是在Windows资源管理器中打开关联的源代码文件。无论复杂程度如何(包括经典的 hello world),我所有的.pl文件都是相同的。

I have perl scripts which were running in Windows 7 just fine as of this morning. I made the mistake of using NotePad as the default for opening/editng my .pl files. Now, when I attempt to run the unedited .pl files from a DOS prompt, the script does not execute but opens the associated source code file in Windows Explorer. This is the same for all my .pl files no matter the complexity (including classic "hello world".

我一直在研究对注册表的更改需求-看起来很好。尝试了assoc和ftype更改-没什么。尝试重新安装ActivePerl-没有解决方案。

I have been researching changes need to the registry - it all looks fine. Tried assoc and ftype changes - nothing. Tried reinstalling ActivePerl - no solution.

推荐答案

您无需进入


  • 进入Windows资源管理器。

  • 查找以<$结尾的文件c $ c> *。pl 后缀。

  • 右键单击,弹出上下文菜单。

  • 选择打开方式(可能只是打开... ,后面带有一个椭圆。目前我没有Windows计算机进行验证。)这将打开一个对话框,其中包含所有各种程序。注意:Perl可能未在初始程序集中列出。不用担心,只需导航至它即可。

  • 对话框底部是一个复选框(类似于使用该程序打开所有扩展名)。确保已选中该复选框。

  • Go into Windows Explorer.
  • Find a file that ends in a *.pl suffix.
  • Right click on it and bring up the Context menu.
  • Select "Open With" (It might just be Open... with an ellipse after it. I don't have a Windows machine at the moment to verify this). This will bring up a dialog box with all the various programs. NOTE: Perl may not be listed in the initial set of programs. No worry, just navigate to it.
  • On the bottom of the dialog box is a checkbox (Something like open all extensions with this program). Make sure that checkbox is checked.

此后,所有以 *。pl 将使用Perl而不是记事本打开。

After this, all files that end with *.pl will open with Perl instead of Notepad.

很可能有人使用Perl脚本来执行此操作以对其进行编辑,并弄乱了文件

It is highly likely that someone did this with a Perl script in order to edit it, and messed up the file association.

但是,曾经这样做的人应该被打一巴掌-不是为了弄乱文件关联,而是为了使用记事本编辑程序。糟糕的开发者!

However, who ever did this should be doped slap -- not for messing up the file association, but for editing a program with Notepad. Bad Developer! No doughnuts for you!

应使用程序编辑器打开程序。如果您是真正的管理员,可以使用 VIM 。 VIM是一个快速而强大的程序编辑器,但是您需要在VIM Ninja大师的脚下实习,才能学习如何使用它。您在VIM的前三到六个月将会是多么愚蠢的程序!太厉害了谁写的这个废话?。然后,有一天,您将了解其功能和效率。您将是该程序的一员。

Programs should be opened with a Program Editor. If you're a real he-man, you can use VIM. VIM is a fast, and powerful program editor, but you will need to spend an internship at the feet of a VIM Ninja master in order to learn how to use it. Your first three to six months with VIM will be What a idiotic program! This is awful. Who wrote this crap?. Then, one day, you will understand its power and efficiency. You will be one with the program.

如果您不勇敢或无所畏惧,或者没有六个月的时间浪费在学习编程编辑器上,则可以使用记事本++ 。与VIM相比,Notepad ++就像是驾驶小型货车。这是安全的,实用的,并且可以完成工作。

If you aren't brave or fearless or don't have six months to waste learning a programming editor, you can use Notepad++. Compared to VIM Notepad++ is like driving a Minivan. It's safe, it's practical, and it gets the job done.

两个编辑器都进行语法突出显示,可以帮助您发现问题。两者(VIM可以-我认为Notepad ++也可以)都提供了语法和用法方面的帮助。两者都可以编辑文件而不会弄乱行尾(它们都将检测文件是否具有Unix或Windows的行尾,并保留它们或允许您对其进行转换)。两者都会为您的行编号,具有广泛的剪切/粘贴缓冲区,强大的搜索和替换功能。并且不会弄乱您的文件编码。

Both editors do Syntax Highlighting which can help you find issues. Both, (VIM can -- I think Notepad++ can too) offer help with syntax and usage. Both can edit a file without messing up the line endings (They'll both detect whether a file has Unix or Windows line endings and keep those or allow you to convert them). Both will number your lines, have extensive cut/paste buffers, powerful search and replace features. And will not mess up your file encoding. Both offer visual diffing between files and do automatic backups when you edit a file.

最后,这两个编辑器都将自己嵌入到右键单击菜单中的上下文菜单中。一份文件。您可以通过单击来编辑文件,然后直接从上下文菜单中选择VIM或Notepad ++。

Finally, these two editors will embed themselves into the context menu you get when you right click on a file. You can edit a file by clicking on it, and selecting VIM or Notepad++ directly from the context menu. No need to select "Open with..." and possibly mess up the file suffix association.

永远不要使用记事本编辑程序。

Never ever use Notepad to edit a program.

这篇关于ActivePerl。 .pl文件不再执行,而是在记事本中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆