On 25-Apr-07, at 8:55 AM, Justin Luster wrote:

Hi,

Recently I’ve noticed intermittent problems in the behavior of my code when running under Mod_Perl 2.0. This particular code has been out there for years with no problems. Recently I’ve seen a few problems and I’m wondering if it has anything to do with Mod_Perl 2.0, it has been running fine under Mod_Perl 1 for years.

Basically the problem that I see is once in a while when the file is opened the file offset does not appear to be at the beginning of the file. After a file is opened I assume the file reader is at the beginning of the file but once in a while it seems like it is reading from the middle of the file after it is opened. Most of the time the code works just fine. Here is the code:

open (authlib::QUESTIONFILE,'<' . $authlib::GlobalPaths[0] . $strQstName) or authlib::ssiDie("Can't open the file $strQstName, \n", $!, 1);

quthlib::QUESTIONFILE is certainly a global in disguise, any reason you can't change to the lexically scoped
open(my $questionfile, '<', [...]);

and use that instead.

This would only be a *big* problem if you are using a threaded httpd MPM with
mod_perl 2.0.

------------------------------------------------------------------------
Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/


Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to