in reply to Re: use/require $MODULE (a variable)
in thread use/require $MODULE (a variable)
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: use/require $MODULE (a variable)
by lestrrat (Deacon) on Mar 17, 2002 at 04:58 UTC | |
by cadphile (Beadle) on Mar 18, 2002 at 08:08 UTC | |
by lestrrat (Deacon) on Mar 18, 2002 at 08:26 UTC | |
by cadphile (Beadle) on Mar 18, 2002 at 09:08 UTC | |
|
Re: Re: use/require $MODULE (a variable)
by cadphile (Beadle) on Mar 17, 2002 at 04:47 UTC |