423,688 Members | 2,579 Online
Bytes IT Community
Submit an Article
Got Smarts?
Share your bits of IT knowledge by writing an article on Bytes.

How to Install and Setup Strawberry Perl

numberwhun
Expert Mod 2.5K+
P: 3,503
**NOTE: This article is written using the 5.8.8 Alpha2 release of Strawberry Perl.

I am writing this article with much joy and glee. This is due to the fact that Active State no longer has a monopoly on the issue of Perl on the Windows platform

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? This was unfortunately due to the fact that Active State does not support every single CPAN module. This literally excludes those who may be working on a project using one of these "forbidden" modules.

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).

So far, the only thing that I haven't been able to get working is the CPAN command line interface (ie: typing "perl -MCPAN -e 'install module::name' ". I have not yet gotten CPAN to install modules in that manner, but for me, it is not an issue to jump into the CPAN shell and install from there.

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.
Nov 16 '07 #1
Share this Article
Share on Google+
7 Comments


KevinADC
Expert 2.5K+
P: 4,059
Any problems to report so far with Strawberry?

In the README doc it states:

Bundle::CPAN (including Perl modules that largely eliminate the need
for external helper programs like "gzip" and "tar")
Nov 20 '07 #2

P: 1
Did you try installing Strawberry Perl first?

You shouldn't need to add any additional tools -- it comes packaged with all the pure-Perl equivalents. It also comes with the CPAN configuration file already setup so that running "cpan" at the command line should "just work".

-- dagolden
Jan 7 '08 #3

P: 98
Others have already mentioned that you only need to install strawberry perl without the other tools first.

Also I just tried:

perl -MCPAN -e "install module::name"

and it worked like a charm.

Notice the use of double quotes (the windows way) instead of single quotes like your attempt.
Jan 8 '08 #4

P: 2
You shouldn't need any of gnuwin32 tools for Strawberry Perl to work. This may have been the case in the past (I was using some of them to hack-install certain modules in the past), but the new version of Strawberry Perl comes with everything you need.

I'm glad to hear that you've turned to Strawberry Perl! I have a VM running Windows and use Strawberry Perl for Win32 specific stuff.

Also, to install from the prompt, you should just be able to type:
Expand|Select|Wrap|Line Numbers
  1. C:\> cpan module::name
instead of going into the cpan shell.
Jan 8 '08 #5

numberwhun
Expert Mod 2.5K+
P: 3,503
You shouldn't need any of gnuwin32 tools for Strawberry Perl to work. This may have been the case in the past (I was using some of them to hack-install certain modules in the past), but the new version of Strawberry Perl comes with everything you need.

I'm glad to hear that you've turned to Strawberry Perl! I have a VM running Windows and use Strawberry Perl for Win32 specific stuff.

Also, to install from the prompt, you should just be able to type:
Expand|Select|Wrap|Line Numbers
  1. C:\> cpan module::name
instead of going into the cpan shell.
By new version, I can only assume that you are refering to the 5.10 version of Strawberry Perl. Do let me know if that is what you are referring to.

When I first installed Strawberry Perl, I didn't install anything extra. I went and did the "perl -MCPAN -e "install Bundle::CPAN" and what it came up with is the setup utility that typically runs for CPAN shell when you haven't run it before.

I skipped all of the tools, being curious about whether it would work, but the installation failed when it tried to download and unzip. I think they have definitely changed things since the 5.8.8 version.

I haven't had any issue with the 5.8.8 version so far and am thinking that an upgrade to 5.10 is prudent in the near future. After I do, an update to or a replacement of, this tutorial will definitely be needed.

Regards,

Jeff
Jan 9 '08 #6

P: 2
By new version, I can only assume that you are refering to the 5.10 version of Strawberry Perl. Do let me know if that is what you are referring to.
Yes, my apologies. I was referring to Strawberry Perl 5.10.0 as the "new version" versus Strawberry Perl 5.8.8 Alpha 2.

My CPAN config has several "blanks" in it where several of the gnuwin32 tools would fit (unzip, gzip, gpg, ....), but it works like it should without those being installed. But, upon starting the CPAN shell, I wasn't stepped through the configuration.

I noticed that your original post was November 16th. The 'final' release of Strawberry Perl 5.10.0 was released on December 23rd. Whenever you feel like it, you might get the final release version and see if it works better for you than before. (and if you're running Vista, there's a note)

Thanks,
Jeremy
Jan 9 '08 #7

numberwhun
Expert Mod 2.5K+
P: 3,503
Yes, my apologies. I was referring to Strawberry Perl 5.10.0 as the "new version" versus Strawberry Perl 5.8.8 Alpha 2.

My CPAN config has several "blanks" in it where several of the gnuwin32 tools would fit (unzip, gzip, gpg, ....), but it works like it should without those being installed. But, upon starting the CPAN shell, I wasn't stepped through the configuration.

I noticed that your original post was November 16th. The 'final' release of Strawberry Perl 5.10.0 was released on December 23rd. Whenever you feel like it, you might get the final release version and see if it works better for you than before. (and if you're running Vista, there's a note)

Thanks,
Jeremy
Ok, I have gone ahead and made a note at the top of the article regarding the version of Strawberry Perl that this pertains to, for everyone's clarity.
Jan 10 '08 #8