bunty
bunty

Reputation: 51

.pl files open in notepad

I am new to xampp, and also, I am new to Perl programming. I just tried to open the file C:\xampp\cgi-bin\printenv.pl and I made a mistake.

I chose the default program to open that file extension as Notepad, with the option always use the selected program to open this kind of file.

Now when I try to run .pl files from cmd it opens them in Notepad instead of executing. Please reply. Thanks in advance.

Upvotes: 5

Views: 2995

Answers (2)

Martin Smith
Martin Smith

Reputation: 4077

ikegami's suggestion did not work for me in Windows 10, but after finding Jack Wu's comment at ActivePerl. .pl files no longer execute but open in Notepad instead I was able to solve the problem as such:

  • Select and right-click a .pl file
  • Use the "Open With" submenu to "Choose another app"
  • Select "Always use this app to open .pl files" (do this now – you won't get the chance after you have selected a program)
  • Scroll to the bottom of the "Other options" to find "More apps", and select "Look for another app on this PC"
  • Navigate to C:/path/to/perl/bin/ and select Perl5.16.3.exe (or the equivalent, depending on which version of Perl you have installed: but not Perl.exe)

Then the Perl icon appears next to .pl files and a double-click leads to them opening in Perl every time, as desired.

Upvotes: 2

ikegami
ikegami

Reputation: 386416

Type the following at a shell prompt:

assoc .pl=PerlScript
ftype PerlScript="c:\...\bin\perl.exe" "%1" %*

(Replace ... with the correct path.)

Upvotes: 9

Related Questions