Solved

how to add a library

Posted on 1999-01-18
4
264 Views
Last Modified: 2010-03-05
I am trying to teach myself perl the 'look at other peoples code' method.  It is going well enough.  Now, I have collected a script that starts as follows:

#!/usr/bin/perl
## Program Name: fetch.cgi
use CGI;
use CGI::Carp (fatalsToBrowser);
use LWP::Simple;

My problem is the last line shown above.  I do not have the Simple routines.  How do I get them and install them.

Actually, I do not really understand how to add libraries at all, or where to find them.  By server is running linux on a 386 arcgitecture macgine if this matters.
0
Comment
Question by:jhurst
  • 2
4 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1210204
0
 

Expert Comment

by:tdv
ID: 1210205
The easiest way to install a module is using the CPAN module that is installed with recent perls.
Try (on the command line):
perl -MCPAN -e "install LWP::Simple"
CPAN stands for Comprehensive Perl Archive Network, a mirrored set of sites that store perl and its modules. The CPAN module automatically locates a CPAN site, downloads the module and installs it.
0
 
LVL 8

Author Comment

by:jhurst
ID: 1210206
tdv,

your method does not work.  

Actually, I discovered that I could just tar the file that ozo recommended in the appropriate place, end of story.

ozo, If you will post an answer, saying anything, I will give you the points.

0
 
LVL 84

Accepted Solution

by:
ozo earned 100 total points
ID: 1210207
You can search for modules at
http://cpan.perl.com/
or
http://theory.uwinnipeg.ca/mod_perl/cpan-search.pl
I'd also second tdv's suggestion on using the CPAN module http://www.perl.com/CPAN/authors/id/ANDK/CPAN-1.44.tar.gz
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question