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

require LWP::UserAgent

There you go, declares a run-time dependency, and even loads the module (without importing) if it hasn't been done yet.

Replies are listed 'Best First'.
Re^2: use: distinguishing compile-time vs run-time dependencies
by perl5ever (Pilgrim) on Aug 08, 2011 at 02:33 UTC
    require basically does the job, but it could be useful to be able to gather the use information more formally.
Re^2: use: distinguishing compile-time vs run-time dependencies
by perl5ever (Pilgrim) on Aug 08, 2011 at 16:31 UTC
    One advantage of a 'use'-pragma to declare the run-time dependency is that the module name can be checked at compile time, e.g.:
    use required Some::Module;
    can verify that Some::Module is in the @INC path at compile time. Simply using require Some::Module won't do that.