Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Installing Perl Modules

by thil (Sexton)
on Aug 30, 2006 at 04:35 UTC ( [id://570304]=perlquestion: print w/replies, xml ) Need Help??

thil has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
Im having a lot of perl modules to intall. (not CPAN modules - Modules written for a particular application)
Currently I am using the follwing Perl Makefile for the installation.

use 5.008003; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'My::Folder::Structure::MyModule', VERSION_FROM => 'My/Folder/Structure/MyModule.pm', PREREQ_PM => {}, ($] >= 5.005 ? (ABSTRACT_FROM => 'My/Folder/Stucture/MyModule.pm', AUTHOR => 'user <user@localdomain>') : ()), );

But if My/Folder/Stucture/ has 15 modules to be installed, I have to change the module name for each installation.

Is there any way to install all the modules in a particular directory at once or in some easier way?

Thanks.

Thilani

Replies are listed 'Best First'.
Re: Installing Perl Modules
by imp (Priest) on Aug 30, 2006 at 04:59 UTC
    My personal preference is to create a distribution for the reusable modules at a company. I have had good luck with the module-starter tool, which is provided by Module::Starter.

    For example:

    module-starter --email "thil@something.com" --author "Thil" --module " +Foo::Bar"
    This creates a Foo-Bar directory with the following structure:
    Foo-Bar/
    |-- Changes
    |-- MANIFEST
    |-- Makefile.PL
    |-- README
    |-- lib
    |   `-- Foo
    |       `-- Bar.pm
    `-- t
        |-- 00-load.t
        |-- boilerplate.t
        |-- pod-coverage.t
        `-- pod.t
    
    The Makefile.PL is generated as follows:
    use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Foo::Bar', AUTHOR => 'Thil <thil@something.com>', VERSION_FROM => 'lib/Foo/Bar.pm', ABSTRACT_FROM => 'lib/Foo/Bar.pm', PL_FILES => {}, PREREQ_PM => { 'Test::More' => 0, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', } +, clean => { FILES => 'Foo-Bar-*' }, );
    Once you add the modules to your lib/ tree you can make a distribution tarball very easily. After that is done you could add these modules to a local CPAN server and use CPAN, or use the CPAN module's API to install locally.

    Personally I use a shell script that I wrote awhile ago. I have a 90% rewritten perl version of the same, but I keep getting distracted.

      Thanks imp. It worked and it makes the task a lot more easy.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://570304]
Approved by McDarren
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-28 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found