On Tue, Nov 06, 2007 at 05:20:15PM +0000, Martin J. Evans wrote:
> It appears from "Can't locate DBI.pm" that DBI is not installed but the
> Makefile.PL contains:
>
> $opts{PREREQ_PM} = { DBI => 1.21 }
Your Makefile.PL doesn't get that far. It gets as far as the "use DBI"
on line 15. You can't make any assumptions about what is installed
until *after* Makefile.PL has run.
> so long as ExtUtils::MakeMaker version is >= 5.43. If I put
> $opts{PREREQ_FATAL} = 1 in the Makefile.PL will this stop this error
> being reported again.
You can put "i am a herring" in there for all the difference it will
make :-) Your Makefile.PL will still break at line 15. The solution
is rather involved:
eval "use DBI 1.21";
if($@) {
... stuff that uses CPAN.pm to install DBI goes here ...
}
eval "use DBI 1.21";
if($@) {
warn("
Something's badly broken with your environment, I couldn't
install DBI
");
exit(0);
}
Do that for every non-core module you want to use in Makefile.PL.
--
David Cantrell | Cake Smuggler Extraordinaire
All children should be aptitude-tested at an early age and,
if their main or only aptitude is for marketing, drowned.