Greg Sabino Mullane wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
1. do not "use DBI" or "use DBI::DBD" because this will cause an
immediate failure if DBI is not installed and now be reported as a failure.
...
$opts{CONFIGURE} = sub {
use DBI::DBD;
Does this work for you? I cannot see how it would.
Yes it does, why do you think it won't?
Ah, I was not clear. I meant why would you expect this to work for people
who have /not/ installed DBI and then run 'perl Makefile.PL'? You also
state above that that you do not 'use DBI::DBD' but then turn around
and do so, hence my confusion as to its purpose. :)
OOPs. Appologies, I contradicted myself and blindly copied erroneous
code. You are of course right, it should be 'require DBI;' to allow
MakeMaker to spot DBI is missing.
...
Adds the dbd_dbi_arch_dir() to include path. DBI is not used anywhere
else in the Makefile.PL for DBD::ODBC. As CONFIGURE only gets run after
the PREREQ_PM check all is ok.
Right, but that 'use' is evaluated at compile time, not run time.
You are right - use require ;-)
Out of interest, what version of MakeMaker are you using?
6.36
Thanks.
FYI, something has changed in ExtUtils::MakeMaker as when I use 6.36
(like yourself) the CONFIGURE sub is being called too early - before the
PREREQ_PM checks. In earlier MakeMaker CONFIGURE sub was run after
PREREQ_PM checks. That would explain why you could not get it to work
even with require. It appears since 6.33 CONFIGURE is run after
PREREQ_PM check so even if this is a bug it would seem this method is
unreliable.
I will update DBI::DBD pod as the most reliable and simple method is to
require DBI and exit 0 if it fails.
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com