in reply to use: distinguishing compile-time vs run-time dependencies

Specifically, a compile-time dependency is a module which needs to be loaded in order for a compile-check to work. A run-time dependency is one that only required to be loaded at run time.
That isn't very different than solving the halting problem, isn't it? Suppose a module "Dependency::Checker" exists, which exports a subroutine runtime_dependency that does what it says:
package Foo; use Dependency::Checker 'runtime_dependency'; use LWP::UserAgent; sub make_agent {LWP::UserAgent->new} BEGIN { make_agent() if runtime_dependency("LWP::UserAgent"); } 1;
What will happen?

Replies are listed 'Best First'.
Re^2: use: distinguishing compile-time vs run-time dependencies
by perl5ever (Pilgrim) on Aug 08, 2011 at 16:29 UTC
    I'm not asking for a why to figure out what kind of dependency a module is. I'm just asking whether it is useful to _declare_ what kind of dependency a module is.
      Well, unless the declaration isn't enforced (that is, it's only informative), it's the same problem. But if it's only informative, you can already do this; it's called "comments".