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

I have been itching for a feature in cpan/cpanplus for a while now. I would like to run a command (say "cpanp installdeps") that would parse the Build.PL or Makefile.PL file in the current directory and install any missing prereqs.

Does this feature exist? Have I just missed it? If not, would others like to see a similar feature? Should it be implemented as a plugin to cpanplus?

BTW, I know I could get something akin to this using Module::Install, but I would prefer to avoid it. I think M::I tries to do too much, and I have had many issues with it, particularly under cygwin. Plus, I would like this to work with other authors modules.

Thanks,
Mark

Replies are listed 'Best First'.
Re: cpanp installdeps
by eserte (Deacon) on Dec 21, 2007 at 20:40 UTC
    Just run cpan . to install the distribution in the current directory including installing all dependencies.

      Genius! How could I have missed this?

      It would be nice to be able to just install the dependencies, though. This seems to install the module as well.

      cpanp should have something like this too.

        As a hack, you could inject a failing test to the test suite. Something like touch t/failing.t should do it.

        Though an installdeps command would be nice.

Re: cpanp installdeps
by FunkyMonk (Bishop) on Dec 21, 2007 at 20:43 UTC
    Start cpanp and type "s reconfigure". Option 5 (basic preferences) eventually allows you to choose between:

    1> No, do not install prerequisites 2> Yes, please install prerequisites 3> Ask me before installing a prerequisite 4> Build prerequisites, but do not install them

      Thanks FunkyMonk. I am familiar with that config option (it is vital!), but it doesn't quite get the functionality I am looking for. I want to run on a currently unpacked, local module. And I don't want it to install the module, just the prereqs. Something like:

      $ cd Perl-Critic-xxxx $ cpanp installdeps . Missing prereqs: Config::Tiny Module::Pluggable Installing prereqs... Done.