Mike P. Mikhailov wrote:
Hello [EMAIL PROTECTED],

Tuesday, August 05, 2003, 2:55:52 PM, you wrote:

cfr> Hi list,

cfr> One questions for the braves ;-)

cfr> As I understand, the directive

cfr> PerlModule Foo::Bar

cfr> loads the module but doesn't import the symbols since it is equivalent to
cfr> the use Foo::Bar (). Therefore I should use "use Foo::Bar" in each program
cfr> only to make the import.

cfr> Is there other way to load the module and import the symobols specified in
cfr> @EXPORT at mod_perl reloading time, without adding a special line in each
cfr> and every script using them?
cfr> Perhaps some options passed to PerlModule though adding (...) doesn't help
cfr> since PerlModule expects a list of modules.

I think this will work

<perl>
      use Foo::Bar qw ( ... whatever you want to import ... );
</perl>

I think Lian was asking how to import symbols into his scripts/handlers at the server startup.


Lian, you *must* put the "special line" in each and every script you want the symbols to be exported to, because exporting happens inside the script's namespace, which is no main:: under Apache::Registry, but special for each script.

You can preload registry scripts using Apache::RegistryLoader, but this doesn't remove the need for an explicit import.


__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com



Reply via email to