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:
What will happen?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;
In reply to Re: use: distinguishing compile-time vs run-time dependencies
by JavaFan
in thread use: distinguishing compile-time vs run-time dependencies
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |