0

How to install perl module Util.pm .I am missing this module .What is the procedure to install a perl module

3
  • Any particular platform? Nov 23, 2010 at 6:40
  • Linux,Cent Os....
    – Rajeev
    Nov 23, 2010 at 6:54
  • You can usually just do "yum provides */<name of file/module>" to find out what package, if any, provides the module. But in this specific case "Util.pm" is a very common name and tens of packages provide it. You need to identify which module requires its "Util.pm" by looking at the source or at the path in the error message.
    – Bruno9779
    Apr 17, 2015 at 1:36

4 Answers 4

2

Regardless of which platform you may be on, you may be able to install the module using the CPAN shell. You can drop down to the CPAN shell by running the command:

perl -MCPAN -e shell

and from there use the install command to fetch and install the module you need installed.

The perldoc for CPAN is helpful in understanding how to use CPAN and what it does and how it works.

You may use the i /Util/ command to search modules and packages that match the given pattern. Or, you could go to search.cpan.org and look for the module you are looking for.

3
  • Do u mean to say install util.pm??
    – Rajeev
    Nov 23, 2010 at 6:55
  • And how to list and remove modules..
    – Rajeev
    Nov 23, 2010 at 6:56
  • @Rajeev: I have updated my answer with more information. I am afraid you will have to find the exact name of the module you are looking to install.
    – ayaz
    Nov 23, 2010 at 7:49
2

Quite a lot of Perl module are available as rpm packages for CentOS, some in the base repos and quite a few more in rpmforge and epel repos. Easier and faster than using cpan and the module will be updated when you update your CentOS install if an update is available.

See this page for a list of extra CentOS repos.

1
  • I upvoted this answer, because using precompiled binaries is faster and cleaner than using CPAN. Specially on a production server
    – Bruno9779
    Apr 17, 2015 at 1:38
2

I really like cpanm, it makes it very easy to install perl mods. Have never had a problem with it and saves me a lot of time.

cd /tmp
wget http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.4008.tar.gz
gunzip App* && tar -xvvf App*
cd App*
perl Makefile.PL
make && make install

( make sure you have gcc installed)

Now all you have to do if you want a mod just cpanm <_MOD_NAME_> ( cpanm POSIX::RT::MQ ) POSIX::RT::MQ is the mod you want / etc

1

You might want to install Utils, not Util. The easiest way is to use CPAN. Just type:

cpan install Utils

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .