I have the following question in perl.
1) Is it possible to install multiple version of perl(example perl version: 5.6 and perl version 5.24) in windows system.
2) In case if the above question 1 is possible then how to call the perl file using version. For example, call the new version perl file from old version of perl file.
On Windows systems
You can use berrybrew
To get a list of available versions:
berrybrew available
Based on available versions you can install with following command:
berrybrew install 5.10.1_32
To switch the version:
berrybrew switch 5.10.1_32
On unixy systems
Using perlbrew, you can install different versions of Perl.
You can run a single command against a specific version of Perl using the following command:
perlbrew exec 5.27.11 myscript.pl
You don't need to do anything special. Strawberry Perl is the de-facto standard version of Perl for Windows, and its installer gives you the option of specifying to which directory you want to install it.
For example, I have
...
C:\progs\sp5280-x64 # Perl 5.28, 64-bit
C:\progs\sp5300-x64 # Perl 5.30, 64-bit
C:\progs\sp5302-x64 # Perl 5.32, 64-bit
Simply specify which Perl you want to use when you launch a program.
C:\progs\sp5302-x64\perl\bin\perl a.pl
By editing your PATH and the file association for .pl files, you can set the default perl used from the console and by double-clicking a .pl file.
I suck at Windows administration, but here goes my stupid suggestion anyway.
1)Install different versions of perl in different folders.
2)Include all folders in the %PATH% variable.
3)Rename the perl executables to its version:
perl.exe (5.4) --> perl5_4.exe
perl.exe (5.6) --> perl5_6.exe
4)When using the console to execute it, use
perl5_4 [file]
My honest recommendations are:
Use VirtualBox or any OS virtualization application, which is heavy in hardware requirements but works like wonders.
For any multi-version environment, always use Docker.
Just use Linux and install perlbrew
Simple Way to Do this use Virtual machine
and insall os in VIRTUAL BOX and Install old/new Version in Virtual machine.
Download Virtual BOx
Related
I downloaded strawberry perl 5.20.1 to my windows 7.
I also installed cpan module.
However when I run the program, it still shows that cannot find NET::OpenSSH
Should I make correct path in environment variables on my computer? If yes, how an what is the correct path?
Should I use something else instead?
I just want to login to Linux box from windows 7
From perldoc Net::OpenSSH,
On the other hand, Net::OpenSSH does not work on Windows, not even under Cygwin.
[..]
Net::OpenSSH does not work on Windows. OpenSSH multiplexing feature requires passing file handles through sockets, something that is not supported by any version of Windows.
As documented in Net::OpenSSH #Known Issues
Known issues
Net::OpenSSH does not work on Windows. OpenSSH multiplexing feature requires passing file handles through sockets, something that is not supported by any version of Windows.
Alternatives
For alternatives, look at:
Net::SSH::Perl as suggested in How to SSH from Perl script from windows machine to EC2 machine.
Net::SSH2 as suggested in Unable to install the perl module Net::SSH::Perl on windows 64 bit.
This is my first day with Perl. I am confused with multiple versions of Perl on my system (Windows 7 32-bit). After installing DWIM Perl when I checked for a Perl installation using 'perl -v' it was showing
This is perl, v5.8.8 built for msys-64int
and after setting the path of System Variables to the E:\Dwimperl\perl\bin directory it is showing
This is perl 5, version 14, subversion 2 (v5.14.2) built for MSWin32-x86-multi-thread
Does Windows comes with Perl installed? And will overwriting PATH do any harm?
No, Windows doesn't have Perl installed by default. Someone before you has installed Perl 5.8.8
You probably won't do any harm adding a location to the PATH environment variable, but your question isn't clear. Have you changed it to just ...\Dwimperl\perl\bin, or have you added it to the end?
You really shouldn't use relative paths in the PATH list, if that is what you've done. Do you really have three dots in there? If so then I am surprised that it works at all.
I suggest you run appwiz.cpl and look to see what is installed there. Remove the older Perl if you are sure there is no need for it.
Also, I recommend that you use Strawberry Perl rather than the DWIM fork. The only real difference is that it has a lot of additional modules pre-installed that you may well not need, at the expense of being a couple of versions behind basic Strawberry Perl
I tried to install Perl 5.16 module 'Template-Toolkit' on windows 7 by using this command in cmd:
C:>ppm install Template-Toolkit
ppm install failed: Can't find any package that provides Template-Toolkit
All other modules I installed (AppConfig, DBI, DBD-mysql, MailTools, GD, Chart, GDGraph, ..) succeeded.
Following this webpage as a guide, they mention (under ActivateState Perl section) that you may not install Perl into a directory that contains a space (eg "C:\Program Files"), because it will break the Template-Toolkit installer. Since I installed Perl directly in 'C:\' -> 'C:\Perl64\', this could not be the case.
Is there a solution for this problem? Or should I use an older version of Perl, mentioned here?
The only errors in the error log are errors in the documentation (minor encoding issues).
The module could be installed safely. Just use cpan to do it. You'll just have to force the installation.
C:\>cpan
cpan> install Template
For me, that runs without issue. (The failing tests are skipped since they're dev-only tests.) If if fails for you and the only failures are the two errors from t/zz-pod-kwalitee.t, you can safely follow up with
cpan> force install Template
According to the ppm template-toolkit page, the build for ActiveState's Perl 5.16 failed (which is why it isn't available).
Your options seem to be:
Fix whatever bug is stopping it being built (it looks like it is just a couple of tests on the POD, so it could be an easy fix)
Use an older version of ActiveState Perl
Use a different distribution of Perl for Windows (such as Strawberry Perl)
Use a different operating system (e.g. Ubuntu in a virtual machine)
I got Warning and Error messages after these commands:
C:\>cpan
cpan> install Template
Please seen the screen shot below.
I haven't tried it myself but you can get Template::Alloy from the ActiveState PPM: http://metacpan.org/pod/Template::Alloy which claims it supports the TT2 syntax among others.
What is the process to manually installing Perl modules on Windows XP? I've seen UNIX commands like
perl Makefile.PL
make
make install
but I can't find a comparable 'make' command in Windows commandline. I cannot use CPAN to install the modules, as firewall settings prevent the network accesses needed. Any help is greatly appreciated.
Strawberry Perl includes dmake which, to my knowledge, is essentially the same as make except it's built for a Windows environment. There are also other alternatives such as GNU make.
Nowadays Strawberry Perl includes gmake tool.
Trying to use dmake outputs DMAKE WARNING: Do not use dmake.exe utility as it is no longer part of Strawberry Perl, use gmake.exe instead!
I've got some perl source code here, how do I build it on Windows, to get a windows binary that I can work with?
Usage of external tools normally comes with compatibility issues, random errors etc. You are better off using the inbuilt perl 'pp' tool. Install PAR::Packer (which includes the pp tool) module and then read the manual for it...
It allows you to pack your perl scripts to executables, and has options as what modules and dependencies to include, I've used it on winXP and win7 and never had an issue with any executabe produced.
pp manual
I've found Cava Packager to be just what I needed.
(source: cavapackager.com)
How to compile Perl scripts into EXEs
Download ActivePerl 5.10 for Windows.
Install it.
Restart your PC.
Download Cava Packager
Install it.
Open it.
Make a new project choosing a blank folder.
Scripts > Add..
Choose your .PL script file
Perl library > [...]
Choose "C:\Perl\bin\perl510.dll"
Add
Choose "C:\Perl\lib\"
Save
Build
You could use the Perl Development Kit from ActiveState to "compile" your script to a .exe file. I used it to create binaries of MRTG and a couple tools more to be deployed on windows servers running as a service. There used to be another product (from IndigoStar or something) called perl2exe I think to get the same result.
Just a note that Cava Packager also supports creating executables from Perl code on Linux and Mac OS X in addition to the original Windows version.
Note: As indicated by my name, I am affiliated with Cava Packager.