Connecting Tech Pros Worldwide Help | Site Map

How to install a package in OS X

Newbie
 
Join Date: May 2007
Location: Leominster, MA
Posts: 4
#1: May 16 '09
I'm new to OS X & Perl in general and have no experience in installing packages. I got the following message: "Can't locate Mysql.pm in @INC". I assume I need to install the Mysql.pm. Can someone post a simple step-by-step list of how to do this for me? I'd really appreciate it. Or, maybe better, point me to a reference on how to install packages?
Thanks much!
gpraghuram's Avatar
Expert
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,256
#2: May 19 '09

re: How to install a package in OS X


Hi,
The first step would be downloading the package from the website www.search.cpan.org
Then extract the zip or gz file.
run the command
perl MAKEFILE.pl prefix <your path>
make
make test
make install

Then you shuld set the PERL5LIB variable properly with the ptah where u installed the PM.

Raghu
numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,565
#3: May 20 '09

re: How to install a package in OS X


Quote:

Originally Posted by peterv6 View Post

I'm new to OS X & Perl in general and have no experience in installing packages. I got the following message: "Can't locate Mysql.pm in @INC". I assume I need to install the Mysql.pm. Can someone post a simple step-by-step list of how to do this for me? I'd really appreciate it. Or, maybe better, point me to a reference on how to install packages?
Thanks much!

Another way would be to use the CPAN interface that comes with Perl. This is easier, especially if you haven't installed software before on a Unix based OS.

The interface is pretty simple to setup, I usually just take the defaults as I am not doing anything extremely specialized and after that, its just a matter of doing an "install <module_name>".

Either way, when you get an error that "something.pm" was not found in @INC, that usually means that the module you were trying to use is not installed and if it is, then the path is not listed in @INC and you need to get it into the @INC path. (fyi, @INC can really only be modified at installation of Perl).

Regards,

Jeff
Reply