views:

58

answers:

2

I inherited a project which is supposed to be able to be deployed to other servers. This project has a number of simple module dependencies which however might not be present on all target machines.

As such I'd like to be able to run a single command line script that checks which Perl modules are installed and tries to automatically install missing ones via CPAN.

Since this should be very basic (i.e. needing to install stuff to run the module installer would defeat the point) said script should only use Perl 5.8.8 core modules.

Does something like that exist already or would i need to write it myself?

+2  A: 

Use Module::Install, it will be bundled with your module/program. You can use "auto_install" command to automatically install dependencies.

Alexandr Ciornii
Two problems with that. First off, according to Module::Corelist that's not part of 5.8.8 core. Secondly, the project itself will be deployed via pulling from github. It's not even close to being in a sane enough state to be considered for deploying by Module::Install.I'm really only looking for a one-shot batch installer of a list of given modules.
Mithaldu
As I said, it will be bundled. And it will be bundled automatically if you use it. But, of course, it will require some simple refactoring.
Alexandr Ciornii
+5  A: 

Creating a Bundle package is one possible answer.

You can then look at something like CPAN::Shell (see CPAN module) to automate the process.

/I3az/

Update re: brian's comment about Task:: - Here are some pertinent links:

draegtun
This works absolutely perfect. Thanks a lot. :)
Mithaldu
Task:: is the new Bundle:: :)
brian d foy