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.

4

3 回答 3

4

如果您使用的是 MAC OSX,只需启动终端并输入“cpan”。让它自动配置并做一些事情,然后您只需键入即可安装模块install Your::Module::Name。要退出 cpan,只需按 ctrl-c 或键入quit

您也可以使用cpan -i 'Your::Module::Name'.

注意:您可能需要输入sudo cpan密码,而不仅仅是 cpan,具体取决于您的 mac 配置方式。

只需在 Mac 上获取make命令,您需要前往应用商店并安装最新版本的 XCode,然后打开“命令行实用程序”选项。在此处查看更多信息:Xcode 4.4 and later install Command Line Tools

于 2013-09-04T16:03:34.957 回答
0

安装 perl 模块的常用方法是使用 cpan,它应该包含在您的系统中。

例如: cpan DBI

于 2013-09-04T15:36:14.213 回答
0

安装 Perl 模块的最简单方法是使用 CPAN 模块本身。

通过命令行 perl 运行 Perl CPAN 模块并将其安装在一行中:

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

如果您以 root 用户身份登录,请不要使用sudo.

于 2015-04-16T12:10:43.633 回答