I've recently written some code that behaves in a way I don't understand. It's basically a Handler that works for more than one VirtualHost. For each VirtualHost that uses the Handler, a call is made to App->loadPages(). It crawls an accompanying lib directory and loads the pages into a hashref, which is then stored in a global hash inside App.

Later, during requests, the Handler calls App->getPages("key"), where key is a unique name for each virtual host. This _should_ return a hashref full of page objects, but it returns undef.

Since the App module is pre-loaded (in startup.pl), and loadPages() fills the hash, shouldn't the Handler's calls to getPages(key) work? I know it can, because I had it working a couple weeks ago, but something has broken it.

It looks as though this works during the first 'load' that Apache does, which I'm assuming is the phase that checks for errors. The second phase seems to cause my global hash to get undef'ed, even though the loadPages() method works properly.

I can divulge more code if necessary, but perhaps someone can clue me into why this happens.

Cory 'G' Watson
http://www.loggerithim.org



--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Reply via email to