Search your unanswered perl queries

Friday, November 16, 2007

Perl Module : How to Install Perl Module on Windows

The most simple task to make your tasks simpler is installing a perl module on your machine.
There are three common ways by which one can install a perl module on your machine. Lets see the installation on windows machine in this post.

There is a ppm utility provided with every active state perl installation, atleast I got it with perl Vesion 5.8.X All you have to do is follow the below steps

1) Click Start
2) Click Run
3) Type cmd and press enter
4) Type ppm and press enter
5) Once you get the ppm utility prompt like ppm> type install modulename
eg. install Net::SSH::Perl
The ppm utility will carry the installation of the perl module for you.

There is workaround for this if you don't have ppm utility or want to install the module manually. Download the zip file from cpan and unzip it with unzip utitliy. Go to the respective directory on command prompt and enter the following commands in sequence.

1) c:\>Net-SSH-Perl>perl Makefil.PL
2) c:\>Net-SSH-Perl>nmake
3) c:\>Net-SSH-Perl>nmake test
4) c:\>Net-SSH-Perl>nmake install

And the module will be installed for you.

Do comment on how you install the new perl modules.


jlk said...

Just wanted to let you know that Active State no longer has a monopoly on Perl on the Windows platform.

If you check out my article on TSDN, you will be able to read about Strawberry Perl. That enables you to use the CPAN installer, as you would on Unix, and have ALL of the CPAN modules available to you, not just what Active State dictates.

Anonymous said...

Better solution:

Nexis said...

Did some search and found the link JLK was talking about. Using CPAN from Windows A great thing indeed. So all those people who use CPAN can check out the above link. The only turn is one will have to use strawberry perl instead of Active State.

JLK please correct me if I have posted the wrong link

Nexis said...

Thanks for the link anonymous helper.
I was not on that page before. Some good pages on the link anonymous provided are

Compiling C/C++ based Modules under ActiveState using MinGW
Installing Modules on a Web Server

Installing CPAN on a Windows system
Installing perl modules via webmin

jlk said...

You are completely correct Nexis. That is the link. :-) Strawberry Perl has been working great for me and I recommend switching to it, especially if you are fed up with Active State and the Monopoly they used to have.

jst said...

thanks for the info

Hari said...

the ppm tip helped a lot. Saved time downloading nmake etc. Worked like a charm for me. Thanks

Anonymous said...

As an intermediate perl scriptor I have just added this "How to" to my favorites. Thanks

Anonymous said...

If you're using portable Strawberry perl for Windows, you can use dmake located in ./stawberry-perl/c/bin

Anonymous said...

Nice post. Note that it might be necessary to run "vsvars32.bat" (from your visual studio directory) before using nmake.

Anonymous said...

I have Strawberry Perl (and DWIM Perl) installed on another machine. I need to install a ppm module.
Do you know a way to do it? namely, install a PPM module from Strawberry Perl?