Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux perl module management

Tags:

perl

Is there any programs other than CPAN to install/compile perl modules and install them?

Mainly I am looking for something like the Activestate PPM, the closest I could find was PPM on CPAN but when I try to install it fails for some "unknown" reason. I am sure if I dug through the output I could find why but it mostly greek to me about make errors.

Anyhow is there anything? It would be nice if it had a GTK front end on account of I use GNOME on Ubuntu and it would be nice for playing with new modules.

What I really want is the ability to install and uninstall modules by command line atleast.

Also, is it possible to script a perl module install? For example when someone installs my .DEB package is there a way for it to retrieve the source code from CPAN (using CPAN if need be) and build it for the system?

like image 493
ianc1215 Avatar asked Apr 03 '11 14:04

ianc1215


People also ask

How do I see what perl modules are installed on Linux?

Check installed perl modules via terminal Available commands are: l - List all installed modules m <module> - Select a module q - Quit the program cmd? Then type l to list all the installed modules, you can also use command m <module> to select the module and get its information. After finish, just type q to quit.

How do I use perl modules in CPAN?

To install Perl modules using CPAN, you need to use the cpan command-line utility. You can either run cpan with arguments from the command-line interface, for example, to install a module (e.g Geo::IP) use the -i flag as shown.

How do I find my Perl library path?

This answer assumes that the module is in fact installed, but not in a place that perl is looking for. Or you can modify the script to use lib ; there is more than one way to do it ;-) Show activity on this post. perldoc -l Your::Module - display path to library if it's installed and found in PERL5LIB, -I, @INC, etc.


2 Answers

On Ubuntu (your mentioned OS), use the CLI (Command Line Interface) with Aptitude. It is easy to install Perl modules this way. 99% of the modules you will find on CPAN are available for install this way.

Syntax for searching available modules:

apt-cache search [keywords]

Below: Example search for the "Template" module for Perl (include perl in the search keywords to make sure you are looking at perl modules). The search is performed on the description, not the title so this gives you latitude in your search terms.

apt-cache search template perl

Install the module you found

sudo apt-get install libtemplate-perl

or perhaps you would prefer

sudo apt-get install libhtml-template-perl

and you could also grab the docs

sudo apt-get install libtemplate-perl-docs

The module name is usually in the format

lib[module]-perl

With the module part being the proper CPAN name. However, sometimes this is not exact. the 'apt-cache search' will find what you are looking for. Additionally, because the search is performed on description over title, you will find other "like-minded" modules.

Have fun..

like image 158
Xybersolve Avatar answered Sep 24 '22 22:09

Xybersolve


Padre has a more graphical module manager.

like image 38
matthias krull Avatar answered Sep 20 '22 22:09

matthias krull