Perl trick: installing Perl modules using CPAN

Translation of the original in Catalan. Read it in: CatalàCastellano

There are a few ways of installing perl modules, the one I like most on a Gentoo is doing it with emerge, of course. But sometimes, there are small modules that aren't in the system since they don't have a direct dependency on any package and they haven't been added to portage, then we have to do things as ugly as a 'make install'. Well then, I've found a more comfortable and slightly 'prettier' way of doing it. So if it helps you if for example, you install an application programmed in perl that has the dependency of the module: Date::Calc and this one isn't in portage as is the case, you can install like this:

perl -MCPAN -e shell
cpan> install Date::Calc

Perl will do all the work of downloading, compiling and installing the file for you. What's a bit more annoying is the first time we use it when we have to answer the questions of a 'wizzard' that helps us configure CPAN (The Comprehensive Perl Archive Network).

3 comments

Comments from the old blog, as they were written. Comments are closed.

  1. —

    no!! no!! no!!... així enguarres el sistema per que el mòdul de perl que instal·les no queda registrat al sistema de paquets i despues es una merda per mantenir-lo i actualitzar-lo... gentoo té una solució molt mes elegant per a això, es diu g-cpan.pl, tens un post que vaig fer sobre el tema aqui:

    http://pof.eslack.org/blog/2004/11/08/una-petita-joya-de-gentoo-g-cpanpl/...

  2. —

    Ostres, aixòs i que esta guay... doncs als manuals de la gentoo no en diuen res els cabrons :)

  3. —

    Aixo us passa per no tenir un debian amb el seu marevellós apt-get... 8) (ho sento, no em puc treure les ulleres)