Until now I used ActiveState's ActivePerl, and used the ppm for installing modules.
Last week I moved to Strawberry Perl, but I don't know how I should install modules using Strawberry Perl. What is some information on how module installation is done using Strawberry Perl or is there some link on how to install new modules?
You can still use ppm, but it is not recommended. Run CPAN client from the Strawberry Perl or Strawberry Perl (64-bit), sub folder Tools, entry in the Start menu.
Type install Module::Name there.
As Alexandr says, you can use the CPAN client via the start menu. You can also install modules just as you would on Unix from the DOS window:
perl -MCPAN -e shell
install Quantum::Entanglement
You can also download the .tar.gz from CPAN, unzip it and install as you would in Unix:
cd Module-Name-1.23
perl Makefile.PL
dmake
dmake test
dmake install
You may need to make sure your %PATH% environment variable has the right entry to get to Strawberry Perl, and does not contain other copies of dmake or gcc, which will sometimes lead to headaches.
Change the directory:
cd C:\Strawberry\perl\bin
Then
C:\Strawberry\perl\bin>cpan Lingua::EN::Sentence
and the module will install automatically.
CPAN is the easiest installation method.
As Alex has noted, you may have to download a .tar.gz and unzip it. Since he wrote his answer, Strawberry Perl has deprecated dmake, and you should use gmake instead.
Related
I have downloaded and installed Strawberry Perl on a Windows 2012 R2 server to run Bugzilla. I have everything installed and configured fine, and Bugzilla is running, but I have a requirement to use LDAP integration. So I tried to install the Net::LDAP module using perl install-module Net::LDAP, but it fails to install because it needs GSSAPI which requires krb5_config.
After working with the people at Bugzilla, I have installed the MIT Kerberos for Windows with the SDK, and ran perl install-module GSSAPI --shell to get to CPAN. Then I ran look GSSAPI so I could download everything and try making the file, but this is where it is failing. I can't figure out what command to run next. I tried MakeFile.pl --gssapi_inc as well as MakeFile.pl --gssapi_libs, but both give me this error:
run "perl Makefile.PL --help" to see further installation options if options gssapi_libs or gssapi_lddlflags are provided, then gssapi_inc must be as well at C:\STRAWB~1\cpan\build\GSSAPI-0.28-JPLEEE\Makefile.PL line 89.
I am now completely lost as to what I need to do to install the Net::LDAP module.
Note: I am using Strawberry Perl and not ActiveState perl so installing via PPM is not an option.
Second NOTE: I know this might be off topic for Stackoverflow but as it does relate to programming I thought it might fit here, if it is a better fit somewhere else please just flag to move.
Actually, Strawberry Perl does come with the PPM module installed, so you can use ppm to install modules. Personally, I have never used ppm to install modules with Strawberry Perl.
To install a module, you just type 'cpan install [module]'. So for the Net::LDAP module, that command becomes: cpan install Net::LDAP
I just tried to install Net::LDAP using portable Strawberry Perl 5.22.1.2 32-bit on Windows 8 and it installed without any issues.
I do not have the MIT Kerberos installed, but I also tried to install the GSSAPI module and that failed. Part of the output from that attempt showed Linux paths. And the CPAN Testers matrix for that module does not show any tests done on Windows. It's possible that you don't really need to have that module installed and might not be able to install that module on Windows.
Here is my problem. I am running OS X v10.7 (Lion) and want to set up an old Perl program I have written (was then using a Windows System with ActivePerl and then its ppm).
I read to use CPAN to install Perl modules (I am trying to install the Graph module). Whenever I tried to install it, it failed from a refused connection. Why? So I read that I should run the following to update CPAN and fix any broken links:
cpan> install Bundle:CPAN
cpan> reload cpan
cpan> index cpan
cpan> exit
However, after doing this I am stuck with this every time I try to do a CPAN install or upgrade:
New CPAN.pm version (v1.9800) available.
[Currently running version is v1.9456]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
I was trying to use the default Perl stuff that is included in OS X rather than downloading ActivePerl. How do I fix CPAN and install the Graph Module?
PS: Running install CPAN and reload CPAN didn't do anything, but it generated the same message.
UPDATE
I was able to upgrade to v1.9800 doing a manual install (make, install) through the terminal. But I am still unable to install the Graph Module. Here is what I am getting:
http://cloud.jjnford.com/3D1C1H4217222b1p1O3a
UPDATE - PROBLEM SOLVED
I was finally able to solve the problem. I just moved the /User/jj/.cpan directory to User/jj/.cpan_bak and then reconfigured CPAN and the Graph Module installed with no fuss.
To solve this problem, do a manual upgrade of CPAN (apparently on OS X CPAN has trouble upgrading itself). You can download the source from here. After you have downloaded it uncompress it, create the make file from the Perl script, then run a make test, and finally if all goes well a make install.
$> tar -xvxf CPAN-1.9800
$> cd CPAN-1.9800
$> perl Makefile.PL
$> make
$> make test
$> make install
Now get rid of your old CPAN configuration:
$> mv ~/.cpan ~/.cpan.bak
Now when you run CPAN from the terminal you should be prompted for the configuration again. Once this is complete and CPAN has started you will notice this:
cpan shell -- CPAN exploration and modules installation (v1.9800)
So CPAN is now upgraded and working, and in my case I installed the Graph Module:
$cpan> install Graph
And everything works fine. I hope this helps somebody.
I have a fresh Mac OS X Lion and I updated CPAN without problems.
Installing XCode is not enough. Make, gcc, g++ are not installed by default.
To install them, one has to:
Start XCode, go to XCode->Preferences->Downloads and install component named "Command Line Tools".
I know this was solved, but do consider using "cpanminus" instead next time. It's faster and could save you a lot of hassle. You can either install App:cpanminus using cpanminus (see: App::cpanminus):
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
And then to install any module and its dependencies simply run:
cpanm <module>
Alternatively you could use it directly from the web:
curl -L http://cpanmin.us | perl - --sudo <module>
I use it on my OS X Lion, and it works perfectly :)
Please excuse me for replying to this old post.
I had the same issue as the OP. Once I corrected the command to contain two colons instead of one (i.e. - Bundle::CPAN vs Bundle:CPAN), it worked as expected.
Am new to perl and its working under windows(using xampp 1.7.4 ).
Am trying to use perl to send email (using gmail smtp).The issue is that i seem to have successfully installed Net-SMTP-SSL with ppm so i was expecting it under c:\\xampp\perl\bin but it seems to have gone under 'c:\xampp\perl\site\lib'.
now when running my script i am getting this :
Can't locate Net/SMTP/SSL.pm in #INC (#INC contains: /usr/lib/perl5/5.10/i686-cy
gwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-cygwin /usr/lib/perl
5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/i686-cygwin /usr/lib/perl5/vend
or_perl/5.10 /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8 /usr/l
ib/perl5/vendor_perl/5.8 .) at getbalanceWindows.pl line 5.
BEGIN failed--compilation aborted at getbalanceWindows.pl line 5.
That's because you're running it under Cygwin.
Using ActiveState ppm will make it available to cmd.exe, not Cygwin.
A couple of options here:
Use cmd.exe
Install Net::SMTP::SSL via cpan to make it available to Cygwin
$ cpan Net::SMTP::SSL
or
$ perl -MCPAN -e 'CPAN::Shell->install("Net::SMTP::SSL");'
Side Note
Does XAMPP necessitate the use of Cygwin? Methinks not, but I may be wrong.
Does anyone know how to install perl's Apache2::Ajax on windows when there isn't a ppm? I have perl5.10. I can download the source tar file but can't use the makefile.pl or build.pl in it to build Apache2::Ajax.
I assume you have ActivePerl. You will need to install mod_perl first, there are additional repositories you can enable in ppm manager options. Then run "cpan Apache2::Ajax" from command line.
I'm pretty rusty with Perl and I don't think it's helping that I'm running it in Windows.
I'd like to install this module. I tried the instructions here to install a CPAN module, but it fails trying to install App::cpanminus (the very first step.) I tried just running cpan Config::Simple and it didn't work either. In both situations, it fails with this error message:
Unwrapping had some problem, won't try again without force
Had problems unarchiving. Please build manually
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Does CPAN just not work from the version of Perl that's installed with XAMPP? If so, how do I upgrade it without breaking anything?
manually download and unpack the distro archive
change into the unpacked directory
run cpanm . or cpan .
XAMPP also ships with PPM in C:\xampp\perl\bin\ppm.bat which is often a more Windows friendly way to get modules for perl.
There's a step by step example of using ppm with XAMPP here: http://www.apachefriends.org/f/viewtopic.php?t=26407
Many modules are already installed in C:\xampp\perl\lib and C:\xampp\perl\site\lib