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 which files you have loaded. Something like:
>
> 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.

See the URL posted in my other reply for the explanation.

> Cheers,
> Mark
>
> On Wednesday, June 20, 2001, at 10:04 AM, Purcell, Scott wrote:
>
> > 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
> >
> > So my question is why this bazaar behavior. If I change the query.pl
> > to a
> > module and use it in each of the pages it is fine. I just find this
> > behavior
> > rather funny. If anyone has any insight please update me.
> >
> > Thanks,
> > Scott Purcell
> >
>



_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Reply via email to