Reputation: 311
I'm using Module::Load
to load certain modules at runtime. However, I have to make do with an older version (2013) that does not import the autoload
function.
Thus, I'm doing something like this:
use Module::Load;
if(some condition)
{
load "Cwd", qw(getcwd abs_path);
}
I can now use the getcwd()
and abs_path()
functions provided by the Cwd
module.
This is clearly not practical when I need to load a module that imports a lot of functions. How can I use load
and still manage to import all the default functions without having to quote them all?
Upvotes: 1
Views: 191
Reputation: 98423
It is usually a better idea to just import what you are actually using. That said, many modules can be asked for qw(:DEFAULT)
to explicitly get all the default exports.
Upvotes: 2