Cannot run any Perl scripts on Windows 8.1 - perl

I installed Active Perl 5.20
and also Strawberry Perl 5.20 after uninstalling Active Perl.
In both cases, when I open cmd and type 'perl' I get:
Unknown Unicode option letter ':'.
This error also prevents all scripts from running on my Windows 8.1 installation.
I uninstalled Perl and did a fresh install and it still doesn't work.
Are there dependencies that I need to install?
I googled the error but the results pertain to Linux installations where the script specified something wrong. But I get this error when I even try to use any perl command line or script. So my problem is not a faulty script.

That is the error message you get from using an invalid value for the -C command-line option. At a guess I'd say you have the PERL_UNICODE environment variable set to a string that contains a colon :.
Take a look at Command Switches in perldoc perlrun for more detail on this.

I too had this problem on windows 8.1 . The problem is that, once on installation, .pl files are not automatically recognized by Perl engine. So please select a .pl file and right click and say open with and set the default program to C\perl\bin\ inside it click perl.exe and recognize it. Once this is done your perl works flawlessly.

Related

Vim plugin does not recognize existing Perl support

I've been using the CoqIDE plugin for Vim on Linux machines for editing Coq files. Now I'm trying to install it on Windows 8. But when I try to source the plugin, I get
Your vim doesn't support Perl. Install it before using CoqIDE mode.
which is strange, because with :version I clearly see +perl/dyn included. Is this different from the +perl that I need?
I heard somewhere that you need to have Perl installed before Vim to get a Perl-enabled Vim, so I tried that as well. I uninstalled Vim, installed Strawberry Perl 5.18.2.2 (64bit), and reinstalled Vim. Still the same problem.
If the solution involves manually compiling binaries, I would really appreciate detailed instructions as I don't have any experience with it.
+perl/dyn just specifies that Vim has been compiled with dynamic Perl support; it doesn't yet check that the Perl library can be loaded successfully. To do that, try executing a Perl command, e.g.:
:perl VIM::Msg("Hello")
This probably yields on your system:
E370: Could not load library perl510.dll
Sorry, this command is disabled: the Perl library could not be loaded.
Next, you'd then have to investigate whether a proper Perl version has been installed and the DLL is accessible (though the PATH).
Download DWIMPerl for windows. I'm running win7 64 and gvim 7.4.2. Using strawberryperl and activeperl resulted in :echo has('perl') to yield 0. By switching to DWIMPerl (and ensuring my PATH env variables are proper) :echo has('perl') now yields 1 using the standard gvim distribution. This is important for vim extensions like dbext which require proper support for perl interfaces.

"EPIC requires a Perl interpreter" in Eclipse Kepler

I have installed Eclipse Kepler and EPIC, the Java Development Kit, and ActivePerl.
When I create a Perl script and try to run it as Perl local I get the error
To operate correctly, EPIC requires a Perl interpreter
I don't understand why that is. Am I going wrong because I have installed Active Perl? Why is it that my Perl interpreter is not detected by EPIC?
I installed EPIC from the betas here. I went to Help/Install new software/Add then I entered this link and followed the instructions. Then my Eclipse also restarted
I am still unable to run a Perl script because of the above error.
You need to specify the Perl executable's absolute path in EPIC configuration under Eclipse. Here are are the steps
Eclipse -> Window (on menu) -> Preferences -> PerlEPIC -> Perl Executable (on hte right hand side pane) -> /usr/bin/perl (this is my perl binary on ubuntu Linux)
The /usr/bin/perl part is important; that's my Perl executable.
Note: The above steps were taken from my Eclipse running on Linux, but I hope you get the idea
Make sure you have the perl interpreter in your PATH environment (ie when you issue a perl command from the cmd prompt, it will be found)

"gcc" command refers to "perl"

Platform: Windows 7 64 bit
Hi all,
I want to compile with gcc. So I have added the path to the gcc binary to the PATH environment variables. Whenever I type gcc in the command prompt, I wish to see something like "no input file specified" (from gcc itself). But instead I get the message "perl is not recognzied".
To cut short, when I type gcc in the command prompt it refers to perl for some reason. I have check all environment variables, and there is nothing that points to perl...
I have rebooted for several times already, without success.
It is not much of a problem to use the full path to gcc when I want to compile just a single file. But when I use make it does not work. Because make uses the gcc command again. Which then refers to "perl".
Any suggestions?
Thanks in advance.
How odd.
Try:
set CC=x:\path\to\gcc
make ...
(See http://www.gnu.org/s/hello/manual/make/Implicit-Variables.html.)
Don't use make on Windows. Use dmake -- available at: http://search.cpan.org/dist/dmake/
make on MinGW(32|64) is somewhat broken at the best of times. Windows Perl's are usually built with dmake (or nmake if you are using Visual C++).

How can I run a Perl script with ActivePerl?

I just recently installed ActivePerl 5.12.2.1202 on my Windows XP in C:/Perl. I am new to Perl scripting.
I just want to run a Perl program which contains one print statement, which I saved in Notepad with the name ex.pl.
How can I run this Perl program?
Can I use an editor for typing a Perl script other than Notepad?
How do I use ActivePerl?
Run Perl program from command prompt
start->run>cmd (command prompt will appear), write perl full_path_of_your_script,
like
C:\> perl hello.pl #This assumes that perl is in your PATH environment variable.
There are many Perl Editors, you can
used for Perl scripts like DzSoft,
Perl Expess, Komodo Edit etc and also see http://www.perlmonks.org/?node_id=169668 and Perlfaq3- Windows Perl Editors for more detail.
Have a look at http://docs.activestate.com/activeperl/5.12/, for ActivePerl 5.12 documentation.
Perl programs (or any other program run by an interpreter) is run by passing the script as a command-line argument to the interpreter. For example, in this case:
perl.exe ex.pl
Padre the Perl IDE and Kephra are good editors for Perl.
As an alternative to ActivePerl, there is Strawberry Perl.
Perl programs are run using the Perl interpreter, perl.exe.
This is normally done from the command line:
C:\>C:\Perl\bin\perl ex.pl
If perl.exe is in your PATH environment variable that can be shortened to:
C:\>perl ex.pl
If you opted to have *.pl files associated with Perl during installation, you can also double-click on them from Windows Explorer.
If you have *.pl files associated with Perl and add .PL to your PATHEXT environment variable you can run them like any other executable:
C:\>ex
Perl programs are just text files. They can be edited with any text editor (Padre, Kokomo, vim, emacs, Notepad++, etc.). Use whichever one you like best.
ActivePerl is just a distribution of Perl. "Using" it usually means running perl.exe to execute your program. ActivePerl also includes the PPM (Perl Package Manager) utility to make it easier to install modules from CPAN, particularly if you don't have a C compiler available. Most experienced Perl developers prefer to use the cpan shell.
Just to add to the other answers, I use EPIC, the Perl eclipse plugin. I'm using Perl on a Windows 7 64 bit machine.
I still run scripts off the command line in windows using ActivePerl, but for development I like being able to dynamically step through the script line by line.
just to not paraphrase other answers and to be more helpful (even if the post is somehow old ) i recommend using the switch "-e" to run Perl scripts if they are composed of few statements e.g
Perl -e "print('hello')"
and of course this requires that the Perl executable is in the Path variable,if not and assuming Perl is under the folder c:\Perl , you can add it by taping :
set %PATH%=%PATH%;c:\Perl\bin
when it comes to the choice of text editor ,I'm still using Notepad++ for almost everything ,it come with some useful features like keywords highlighting and some auto-completion capabilities.

How can I make Eclipse work with `perlbrew`?

I'm using perlbrew to switch between perl versions. I also use Eclipse to write perl scripts.
It seems that Eclipse does not recognize the switches between perl versions, and keeps working with the base version installed out of perlbrew. I tried restarting Eclipse but this doen't help.
So, How can I make Eclipse work with perlbrew?
If you are using EPIC, this will work: Click through to Window->Preferences->Perl EPIC and set the Perl executable to perl5/perlbrew/bin/perl. This always points to the current set version of perl. The path is relative to your $HOME on Linux.
I haven't tried this as I usually just use a text editor for Perl, but I have taken to using the shebang line #!/usr/bin/env perl so that I get the perl for the user that runs the script (ie. perlbrew if me, system perl if root). If Eclipse executes the script (./myscript.pl) this should work, if instead it callsperl myscript.pl` then this will not help you.