Installing modules using Strawberry Perl
Asked Answered
F

4

76

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?

Fordham answered 10/7, 2011 at 21:48 Comment(0)
T
70

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.

Tovatovar answered 10/7, 2011 at 23:5 Comment(4)
On Windows 7, Start Menu > Strawberry Perl > Tools > CPAN Client Salomone
On Windows 8.1, Start>Cpan ClientEvie
On Windows 10, Start Menu > All Apps > Strawberry Perl > CPAN ClientLurdan
I've done the install Module::Name (Date::Calc in my case), but program still fails saying code Can't locate Date/Calc.pm in @INC (you may need to install the Date::Calc module) (@INC contains: C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib) at .\Create_DELETE_XML_20220602.pl line 3. codeWeinstein
J
42

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.

Jonme answered 10/7, 2011 at 23:47 Comment(8)
"cpan" is shorter than "perl -MCPAN -e shell"Tovatovar
well, yes, but I like to be able to check perl -v first to know which Perl I'm running.Jonme
As Alex said, it works fine with: cd Module-Name-1.23 perl Makefile.PL dmake dmake test dmake install dmake is a make program that happens to run pretty well on Windows, as described here.Deaf
you can do it in one line: cpan Quantum::EntanglementEmirate
also you can use cpanm instead of cpan. cpanm might be better if you are new to this, as it has less messages and configuration.Emirate
The You may need to make sure [...] considerations only apply to the second version, right?Golda
No, it applies to both.Rentfree
Strawberry Perl has deprecated dmake, and you should use gmake instead.Photo
U
9

Change the directory:

cd C:\Strawberry\perl\bin

Then

C:\Strawberry\perl\bin>cpan Lingua::EN::Sentence

and the module will install automatically.

Unloosen answered 5/1, 2015 at 9:57 Comment(0)
P
4

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.

Photo answered 16/3, 2018 at 15:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.