1). The two forms of require are:
The first form (according to the book) translates '::' to '/' (on Unix systems), and also treats indirect object notation as methods, whereas the second form requires the '/' path separator and treats indirect object notation as basic function calls. So I really want the first form, so I need to call this withrequire MODULE; require "MODULE.pm";
Is this right?eval "require $module";
2). I realize though that I need to perform some trickery with the symbol tables, I think. What I want is my module PmLoader.pm to take it's LIST input, and then find and load each of THOSE modules into the main package. As I have it now, it's loading these into the PmLoader package, but not into main. So, as was pointed out, when I say
it's the same as sayinguse Pmloader qw( ...args ...);
But then in PmLoader's import method, if I only callBEGIN { require PmLoader; PmLoader->import( qw( ...args...)); }
I'm missing the import. But the import needs to be done to main, not to package PmLoader. Can anyone give me a hint how to proceed here?eval "require $module";
In reply to Re: use/require $MODULE (a variable)
by cadphile
in thread use/require $MODULE (a variable)
by cadphile
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |