Subject: | Hack for conditional dependencies not working? |
On my system Geo::Coder::Bing is installed, but Geo::Coder::Many is not (yet). Trying to run Build.PL fails here:
Can't locate Geo/Coder/Many/Bing.pm in @INC (@INC contains: /var/tmp/cpansmoker-1023/CPAN-Reporter-lib-gEH5 /usr/perl5.8.9t/lib/5.8.9/amd64-freebsd-thread-multi /usr/perl5.8.9t/lib/5.8.9 /usr/perl5.8.9t/lib/site_perl/5.8.9/amd64-freebsd-thread-multi /usr/perl5.8.9t/lib/site_perl/5.8.9 .) at /usr/perl5.8.9t/lib/site_perl/5.8.9/Module/Load.pm line 27.
Can't locate Geo/Coder/Many/Bing in @INC (@INC contains: /var/tmp/cpansmoker-1023/CPAN-Reporter-lib-gEH5 /usr/perl5.8.9t/lib/5.8.9/amd64-freebsd-thread-multi /usr/perl5.8.9t/lib/5.8.9 /usr/perl5.8.9t/lib/site_perl/5.8.9/amd64-freebsd-thread-multi /usr/perl5.8.9t/lib/site_perl/5.8.9 .) at /usr/perl5.8.9t/lib/site_perl/5.8.9/Module/Load.pm line 27.
BEGIN failed--compilation aborted at Build.PL line 54.
Problem is probably that load_module() in Build.PL operates only on @INC, and this fails if Geo::Coder::Many is not yet installed. I think this can be fixed by adding
local @INC = (@INC, "libs");
before calling load_module() (or so, untested).
Regards,
Slaven