Hello, I want to pre-open files in apache's processes. So every modperl handlers will use the file handle directly, instead of re-openning the files each time when the requesting is coming.
Currently I do it with: package Fileopen; use strict; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw($filehandle); our $filehandle; open $filehandle,"<","/path/to/big.file" or die $!; # open for reading only, the file itself is readable only. 1; Then in startup.pl: use Apache2::RequestRec (); use Apache2::RequestIO (); use Apache2::Request (); use Fileopen; # use others... 1; Last in each handler: package Myhandler; use strict; use Apache2::RequestRec (); use Apache2::RequestIO (); use Apache2::Const -compile => qw(OK); use Apache2::Request (); use Fileopen; sub handler { my $r = shift; our $filehandle; # exported from Fileopen # deal with $filehandle ... } 1; I'm not sure, am I going on the correct way for the purpose? Thanks for the helps. Regards.