Hi Jerry,

Most of the perl distribution comes with cpan.
If you don't have cpan by default (say you work with active perl),
I suggest you work with distribution that supplies cpan. If you work on windows 
I reccomend to work with cygwin
(http://www.cygwin.com/).

Best regards,

Yaron Kahanovitch
----- Original Message -----
From: "Jerry Krinock" <[EMAIL PROTECTED]>
To: beginners@perl.org
Sent: Monday, July 30, 2007 1:00:17 AM (GMT+0200) Auto-Detected
Subject: Re: Light at the end of Module Prerequisite Tunnel?

Thanks Shawn and Yaron; I think I got it.  The 'cpan' module does make
life much easier.  I wrote this little summary for the next time I
need a module.

*** PERL MODULE MANAGEMENT FOR REAL DUMMIES ***

CHECKING YOUR SYSTEM TO SEE IF A MODULE IS PRESENT

At your computer's command line, type
   perl -M<module> -e ''
Example: To see if you have XML::Parser
   perl -MXML::Parser -e ''
If the command executes with no complaint, the modules is present.

DOWNLOADING AND INSTALLING MODULES THAT YOU DON'T HAVE

If you want to use in your perl scripts a published perl modules that
you've read about, you can save yourself alot of work by installing
the module "cpan" which is a "module for installing modules".  Get it
from here:
   http://search.cpan.org/~jhi/perl-5.8.1/lib/CPAN/bin/cpan
Then, whenever you want to use a module you don't have installed, type
at your computer's command line:
   sudo perl -MCPAN -e shell
The sudo is used since some modules want to install either source code
or, more frequently, documentation, in system directories such as /
Library/Perl.  Perl will launch and give you a cpan shell with a
prompt
   cpan>
At this prompt, use the 'install' command to download and install a
module you need.  Example:
   install Module::IWant
and then watch the show until it is over, indicated by the cpan>
prompt returning.  Leave this command-line window open because you may
need it again...

Now, attempt to use the newly-installed module in a script.  If you
get an error(s) like this:
   "Can't locate Some/Module.pm"
this probably means that your newly-installed module requires
prerequisite modules that you do not have installed.  Don't cry.  Go
back to your command line running cpan and install the prerequisite
module(s) by typing at the cpan> prompt:
   install Some::Module
Then try to run your script again.  Repeat installing prerequisite
modules until you get no more errors and your script works.

Note that some module names have more than two ancestors.  For example
to if perl
   "Can't locate Some/Very/Deep/Module.pm"
type after cpan> prompt
   install Some::Very::Deep::Module



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to