Re: How to pre-open files in apache's processes
Xiao Lan <[email protected]>
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Dec 2, 2010 at 5:58 PM, Hendrik Schumacher <[email protected]> wrote: > > In the perl file that holds your handler declare a variable on module level: > > my $qqwry = undef; > > In the handler instantiate the object if $qqwry is undefined: > > if (not $qqwry) > { > $qqwry = IP::QQWry->new('QQWry.Dat'); > } > > This way the file should be opened only once in each apache process (which > should be good enough for performance reasons). The my $qqwry on module > level should be persistent in each process. > Hi, I'm not sure, what's "the perl file that holds your handler"? My hanlder is a perl package, which file will hold this package? Thanks.