1

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.

serenesat
  • 4,611
  • 10
  • 37
  • 53
BryanK
  • 1,211
  • 4
  • 15
  • 33
  • 1
    What is "Unix" in your case? It is is Linux, just about every distribution will have the Perl DBI module packaged for you. In any event, `make: command not found` means you do not even have `make` binary installed. – Dirk Eddelbuettel Sep 04 '13 at 15:34
  • If you don't have `make` installed, then you probably don't have a unix configured for software development. You'll have to install a full suite of build tools. compiler, linker, etc... – Marc B Sep 04 '13 at 15:37
  • Im using terminal in mac OSX and Im using the preinstalled version of perl. maybe I should update first? – BryanK Sep 04 '13 at 15:37
  • Are there any software development Kits you would recommend for terminal? – BryanK Sep 04 '13 at 15:43

3 Answers3

4

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

Community
  • 1
  • 1
Mike Driver
  • 8,481
  • 3
  • 36
  • 37
  • 1
    Until you get to the final paragraph, your advice doesn't seem to be Mac-specific at all. It will work for any Unix-like operating system. – Dave Cross Sep 04 '13 at 16:21
  • @DaveCross is right. The final paragraph is the answer to the question. – friedo Sep 04 '13 at 16:24
  • Thanks. XCode Command Line Utilities worked perfectly. Should I be worried about the Skipped tests during the `$ make test` command? – BryanK Sep 04 '13 at 17:02
  • @BryanK no, the distribution knows which tests to skip based on your environment. You should be worried if tests fail, though. – friedo Sep 04 '13 at 21:38
  • @BryanK also, in the future, use a CPAN client like the `cpan` commandline utility to download modules; it will handle dependencies for you automatically. [`cpanm`](https://raw.github.com/miyagawa/cpanminus/master/cpanm) is a lot easier to use (follow the instructions there to install it.) – friedo Sep 04 '13 at 21:39
0

The usual way to install perl modules is using cpan, which should be included on your system.

For example: cpan DBI

AKHolland
  • 4,435
  • 23
  • 35
0

The simplest way to get Perl modules installed is to use the CPAN module itself.

Run the Perl CPAN module via command line perl and get it installed in a single line:

sudo perl -MCPAN -e 'install Module::Name'

If you have login as a root user, do not use sudo.

serenesat
  • 4,611
  • 10
  • 37
  • 53