78

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?

4 Answers 4

71

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.

Sign up to request clarification or add additional context in comments.

5 Comments

On Windows 7, Start Menu > Strawberry Perl > Tools > CPAN Client
On Windows 8.1, Start>Cpan Client
On Windows 10, Start Menu > All Apps > Strawberry Perl > CPAN Client
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. code
@M.S.Visser a search result led me to page github.com/theos/theos/issues/273 and shed some light on this issue. could be that the perl executed did not the match the perl which had the module installed / required. similar issue of mine got fixed by calling PERL_INSTALL_DIR\perl\bin\perl.exe with the same parameters.
43

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.

8 Comments

"cpan" is shorter than "perl -MCPAN -e shell"
well, yes, but I like to be able to check perl -v first to know which Perl I'm running.
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.
you can do it in one line: cpan Quantum::Entanglement
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.
|
9

Change the directory:

cd C:\Strawberry\perl\bin

Then

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

and the module will install automatically.

Comments

5

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.