Search code examples
perlperl-moduledbi

Installing Perl module in Unix


This is my first time installing a Perl module and I'm having some trouble. I'm trying to install manually In UNIX. These are the steps I am following (Installing DBI module in this case)

  1. Download DBI-1.628.tar.gz tar file,

  2. Uncompress file with

    $ tar -zxvf DBI-1.628.tar.gz

So far no problems,
Its the next step that is confusing me... In every tutorial I've seen so far I'm told to locate Makefile.PL then run the following commands:

$ perl Makefile.PL
$ make
$ make test
$ make install

In my case, after locating Makefile.PL and running

$ perl Makefile.PL

...some output follows. I get these messages
Checking if your kit is complete... Looks good & Writing Makefile for DBI

Then I'm back in my user command prompt. Note I still haven't entered these commands

$ make
$ make test
$ make install

From the command prompt if I enter the make command now I get a -bash: make: command not found error.

I'm an absolute beginner at this so please excuse me If I am missing something rudimentary.


Solution

  • If you're using MAC OSX, just fire up a terminal and type 'cpan'. Allow it to configure automatically and do some stuff, then you can install modules by just typing install Your::Module::Name. To get out of cpan just hit ctrl-c or type quit.

    You can also install directly from the command line by using cpan -i 'Your::Module::Name'.

    NB: You may need to type sudo cpan and put in your password rather than just cpan on it's own depending how your mac is configured.

    Simply to get the make command on a mac, you need to go to the app store and install the latest version of XCode, then turn on the 'command line utilities' option. See more on that here: Xcode 4.4 and later install Command Line Tools