Herself’s Webtools

Webtools for Webmasters: Scripts, HowTos, Templates, Plugins, Widgets, Tips and Useful Information

Herself’s Webtools header image 1

Installing PERL modules

July 23rd, 2007 · No Comments

I’m going to be writing some more PERL scripts to make website maintenance easier. Today I hunted down some information on RSS feeds and using PERL to download them.

Ah but since I had not done much with PERL on this computer I got caught in the seemingly endless ‘Can’t locate BlahBlah/Blah.pm’ Egads. For every one I found and installed another one needed to be hunted down.

The very easiest way to do this and retain your sanity is to use the CPAN module that comes with PERL.

As root so you have permission to install modules in the Library Path type:
perl -MCPAN -e shell;

It will ask if you want to do the manual configuration. Hit enter and for almost every question you’ll just be able to hit enter and agree with the option it chose. There’ll be a couple you have to give it response other than enter so pay attention as you go through the questions.

Once that is done you’ll be dropped into a cpan shell
cpan>

Now all you have to do is try to run your program in one terminal window and install missing modules in the cpan window. For example:
./rss2html.pl

Can’t locate LWP/Simple.pm in @INC blah blah blah

So in the cpan window type
cpan> install LWP::Simple

Just replace slashes with :: and drop the .pm. It will locate, compile and install the module for you. Occasionally you will have to force a module.
cpan> force install LWP::Simple

Perl is case sensitive. This is the most painless and easiest way to collect all the modules you will need to run PERL scripts.

* You will probably need to install a module or two to use the Perl Blogger backup scripts I posted in the top left sidebar last weekend.

More information:
Using RSS News Feeds

Tags: perl

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

You must log in to post a comment.