Preventing missing dependencies

Robin Berjon robin.berjon at expway.fr
Sun Feb 26 19:30:00 GMT 2006


On Feb 26, 2006, at 19:44, Paul Makepeace wrote:
> How about: modify the behaviour of 'use' to fail unless a module  
> has been
> listed in the build/test dependencies.
>
> "attempt to use Blah without specifying it as a dependency in  
> Foo.pm line 4"
>
> There's some finesse needed to allow depended-upon modules that are
> pulled in by the parent module, e.g. Jo Programmer shouldn't need  
> to put
> a dependency in for HTTP::Status when using LWP::Simple.

I've lived through the frustration you describe enough to agree that  
it's a good thing to fix it, but putting the onus on use seems wrong.  
I have quite a few modules that I don't intend to make CPAN-worthy,  
and that use other distribution mechanisms, and I wouldn't want to  
throw in a fake list of dependencies that I don't need just to work  
around what use would do. That's way too Java-ish.

One thing that could be nice is to have this check in make dist (that  
is, in all modules that have some code run for make dist). It's a  
safe assumption that module authors want to fix missing dependencies,  
and will be happy to be warned that for the nth time they forgot to  
require DBI, LWP, or XML::SAX. I sure would be.

-- 
Robin Berjon
    Senior Research Scientist
    Expway, http://expway.com/




More information about the london.pm mailing list