develooper Front page | perl.beginners | Postings from April 2008

Re: Perl Modules

Thread Previous | Thread Next
From:
Chas. Owens
Date:
April 16, 2008 18:09
Subject:
Re: Perl Modules
On Apr 16, 2008, at 13:33, Monty wrote:
> Hope this is the right forum for this.
>
> I recently downloaded Curses-1.23.tar from CPAN for installation on to
> my Solaris 8 system.  I installed the module in the same area as all
> my other perl modules: /usr/local/lib/perl5/5.8.5, but I noticed
> there's also a directory named /usr/local/lib/perl5/site_perl.
>
> Under the directory 5.8.5, I untarred the file and it created a
> directory named Curse-1.23 and put everything under it.  I moved the
> Curses.pm module up to the 5.8.5 directory and renamed the Curses-1.23
> directory to Curses, so I can "use Curses" in my scripts.
>
> Is this the correct way to install this module?  My scripts can't seem
> to find it.
snip

No, this is not the proper way to install a Perl module.  You have  
four common routes to installing a module:
1. become root and use CPAN
2. become root and install manually
3. use CPAN as a normal user and set PERL5_LIB (or use the lib pragma)
4. install manually as a normal user and set PERL5_LIB (or use the lib  
pragma)

1. become root and use CPAN:
su -
perl -MCPAN -e "install Curses"
#answer all of the questions, the defaults tend to be correct

2. become root and install manually
su -
gzip -dc module-version.tar.gz | tar xvf
cd module-version
perl Makefile.pl
make
make test
make install
#stop if at any step where you get errors


3. use CPAN as a normal user and set PERL5_LIB (or use the lib pragma)
#like 1., but you should set PREFIX=/some/directory/you/countrol
perl -MCPAN -e "install Curses"
echo "export PERL5_LIB=/some/directory/you/countrol" >> .profile

4. install manually as a normal user and set PERL5_LIB (or use the lib  
pragma)
gzip -dc module-version.tar.gz | tar xvf
cd module-version
perl Makefile.pl PREFIX=/some/directory/you/countrol
make
make test
make install
#stop if at any step where you get errors
echo "export PERL5_LIB=/some/directory/you/countrol" >> .profile



Thread Previous | Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About