Tuesday, November 13, 2007

No More Perl Monopoly for Active State

As anyone who code's Perl on the Windows platform knows, the choice that you have (had) for Perl on Windows was Active State. It worked great for your scripting but when it came to installing modules it wasn't always the easiest thing in the world. Granted, the graphical installer was a godsend for those who don't like command line, but what about when you couldn't find the module you needed to use?

In the past few months I have found a few modules that I was wanting/needing to use in a project and they could not be found anywhere in the PPM (Perl Package Manager - this is what Active State Perl uses). If you investigate further, you will find that PPM does not use CPAN directly (as I think it should) but instead uses the Active State PPM repository by default. There are a couple of others out there as well, but they only add a few hundred packages (modules) to the mix.

Well, I did some inquiring to see if anyone knew of a complete repository to use for PPM, but instead was thrown a link to something completely new. Strawberry Perl! My curiosity peaked and being completely intrigued, I decided to download this new offering and see if it actually worked.

From what I was told, Strawberry Perl used the CPAN interface that most of us are already familiar (or quite intimate with) from the Unix world. That said, for those of you who remember (no matter how vaguely) the CPAN initial setup, the configuration manager looks for the existance and path's of specific utilities in order to be able to do its job.

Well, I made a list of the utilities that it requires and have provided those below for your reference:

The following utilities are located at the gnuwin32 website (or use the gnuwin32 listing page):

  • bzip
  • gzip
  • tar
  • unzip
  • wget
  • less (my favorite pager)
When you download the above utilities, be sure to grab the binary packages. When you unpack the first one, it should go into c:\Program Files\gnuwin32
That is the base path that you should then use for extracting the other 5 utilities as they have the same directory structure internally (ie: bin director, etc)

Here are other utilities that you will need (each is a link to its URL):

  • curl
  • lynx
  • ncftpget (and ncftp) - Both are installed with the same single download. Be sure and grab the client software (version 3.2.1 as of this blog entry).
  • gpg
It is up to you whether or not you put each utilities path into your system path, but if you don't, you will have to enter the path to where each utility is located manually during the CPAN setup, just as I did. Once you get all of these installed, and also have Strawberry Perl installed, you can then run the CPAN configuration by entering the following command:

perl -MCPAN -e shell

That will kick it off. I simply took all of the defaults, with the exception of the utility paths that were not displayed, I entered them manually.

Once I had completed the software installations and gone through the configuration, I entered the following command from within the CPAN shell environment:

install Bundle::CPAN

This confirmed to me that everything had worked as it installed beautifully. I then installed a few modules that I needed and ran a few scripts that were around from when I had Active State Perl on the machine (yes, it was uninstalled before installing Strawberry Perl. Sorry for not mentioning that earlier).

Anywho, I hope that those of you that code Perl on Windows will do your due diligence and go against what used to be a Perl / Windows Monopoly and switch from the limitations of Active State over to the freedom and (IMHO) superiority of Strawberry Perl.
 
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.