Hello,
I have a question about require when using mod-perl. I produced four simple
.pl files.
main.pl, one.pl two.pl three.pl
From the main.pl you can link to either one two or three.pl. Pretty simple.
The problem begins when I put a require in one.pl, two.pl, and three.pl.
If in each of those
Greetings,
require will only happen once per perl process and since mod_perl
is essentially a single perl process, the file is only require'd
for the first request. You can get around this by deleting the file from
the %INC
hash which keeps track of which files you have loaded. Something like:
On Wed, 20 Jun 2001, Mark Doyle wrote:
Greetings,
require will only happen once per perl process and since mod_perl
is essentially a single perl process, the file is only require'd
for the first request. You can get around this by deleting the file from
the %INC
hash which keeps track of
On Thu, 21 Jun 2001, Stas Bekman wrote:
On Wed, 20 Jun 2001, Mark Doyle wrote:
Greetings,
require will only happen once per perl process and since mod_perl
is essentially a single perl process, the file is only require'd
for the first request. You can get around this by deleting the
BEGIN {
delete $INC{'/foo/bar/query.pl'} if exists
$INC{'/foo/bar/query.pl'};
require '/foo/bar/query.pl';
}
Mark, your suggestion doesn't work because of BEGIN.
Ooops, gotta go to sleep. Your suggestion, Mark, will work :) but only in
Registry/PerlRun which executes
Greetings,
On Wednesday, June 20, 2001, at 12:45 PM, Stas Bekman wrote:
Ooops, gotta go to sleep. Your suggestion, Mark, will work :) but only
in
Registry/PerlRun which executes BEGIN on every request.
Sorry about my previous post :(
But if you delete and reload the file on every
I hate to belabor this point, but I don't want people to get the wrong idea:
BEGIN { do '/foo/bar/query.pl'; }
Sorry, I guess I should have been more explicit. I don't want to
require in the file on every request, but rather only allow the
same file to be require'd multiple times (to