4

I've just downloaded ActivePerl for Windows 10 on my 64 bit laptop, but when I go to the command prompt, perl -v fails unless the directory is C:\Perl64\bin in which case it tells me that I have Perl 5.20.2 Copyright Larry Ullman etc, but if I try and open perl files anywhere, nothing happens, if I run perl.exe it just shows me a command window with a flashing bar and nothing happens, and when I try and run .pl programs in Eclipse it tells me predictably that because perl-v failed it won't run.

What can I do to get .pl files running?

Qiri
  • 251
  • 1
  • 2
  • 10

2 Answers2

7

You must create a file association between the .pl file extension and the Perl runtime.

At a command prompt type the following.

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

Choose perl.exe or wperl.exe, depending on your need to get a visible command window.

danvy
  • 2,085
  • 12
  • 17
  • When I try typing assoc .pl=PerlScript I get an error saying "Access is Denied. Error occurred while processing .pl."But I am on an admin account with User Account Control turned off, so I should have full permissions to do everything. – Qiri Dec 29 '15 at 10:15
  • Thanks very much, it should have occurred to me to run it as admin when I got the access denied error, but thanks for that and for the code above. Everything is now working, perl -v shows what it should and I have hello world working in Eclipse. Do you mind telling me what the %1 %* meant at the end of the ftype command? – Qiri Dec 29 '15 at 10:44
1

To get perl to be recognized, you must add C:\Perl64\bin to the PATH environment variable. Go to Control Panel > System > Advanced System Settings > Environment Variables. Edit the line containing PATH in the top box marked User variables for , and add ;C:\Perl64\bin (note the semicolon) to the end. Be sure not to corrupt anything that's already there.

installing perl in windows 7

ByteMe
  • 1,159
  • 2
  • 15
  • 28