perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject Re: Apache virtulahosts sharing modules
Date Wed, 21 Jul 2004 04:44:20 GMT
>
>   Will it work if you have your perl module require a file filled with
> constants for each site? What I've been doing is my module determines
> the current site via $ENV{DOCUMENT_ROOT} and I then construct the
> correct path to the unique config file for each site. I then "require"
> that file in my module. This works for me, but right now I am only
> testing this with one VirtualHost so I don't know if there will be any
> issues. If not, this might be a good way to do it. I didn't want to
> have an Embperl specific include because I also have regular perl
> programs that run as cron jobs and I want them to also get access to
> those constants too. I just feed them the site name from the command
> line since they have no access to the Apache ENV variables, but the
> result is the same.
>
>   Thoughts on this technique?
>

If the files have different path _and_ different package names it will work.
If the files have no package name, it will compiled into the first package
where it is loaded and only accessable from this package/file.

ALso the question is a little different
http://perl.apache.org/embperl/pod/doc/doc13/pod/Faq.-page-3-.htm#sect_19
has an explaination for this behaviour.

Gerald

---------------------------------------------------------------------------
Gerald Richter            ecos electronic communication services gmbh
IT-Securitylösungen * Webapplikationen mit Apache/Perl/mod_perl/Embperl

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
---------------------------------------------------------------------------
ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
---------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message