in reply to Re: Asking a question in Makefile.PL
in thread Asking a question in Makefile.PL

NO, please don't invoke CPAN in Makefile.PL

It is extremely bad practice. It plays havoc with CPANPLUS based CPAN tester rigs ( like mine ), and for people who don't use CPAN but use CPANPLUS for installing modules.

Update

The best way is to just let CPAN/CPANPLUS deal with installing the module for you as a prereq.

use ExtUtils::MakeMaker; my %prereqs = ( "Blah::Blah" => 0, "Foo::Bar" => 1.0, ); eval{require Some::Module}; if ($@) { my $reply = prompt("Some::Module not installed. Install (Y/n)", "Y +"); $prereqs{"Some::Module"} = 0 unless $reply =~ m/n/i; } WriteMakefile( PREREQ_PM => \%prereqs, );

Replies are listed 'Best First'.
Re^3: Asking a question in Makefile.PL
by tachyon-II (Chaplain) on Apr 20, 2008 at 11:20 UTC

    While I'll accept it might not be best practice or suit testing rigs I would be interested to know what the preferred alternatives are.

Re^3: Asking a question in Makefile.PL
by Anonymous Monk on Apr 20, 2008 at 19:12 UTC
    Okay, but what would be the alternative in this case? Could I check if CPANPLUS is what's being used and use that or use CPAN instead?