Fred Lovine wrote: > > Hi, > > I have the following global.asa: > ------------- > require "citylinkweb.pl"; > > ------------- > > But when the required file is edited, the changes do not take effect until > the Apache server is restarted. > Other files are reloading automatically. How do I get this file to > dynamically reload? > > Here are my httpd.conf settings: > PerlSetVar Global . > PerlSetVar StatINC 1
If StatINC does not work for you to reload this at runtime, you might try Apache::Reload to do so. Reloading perl libraries at runtime can have lots of problems, and one is happy when it just works. > And for extra credit: > When the required file has a reference to > $main::Request->ServerVariables('SERVER_SOFTWARE') and is then edited, an > error is generated: > > [Tue Nov 20 01:12:27 2001] [error] [asp] [844] [error] can't require/reload > citylinkweb.pl: Can't call method "Item" on an undefined value at I imagine that this might be from code being run that relies on $main::Request in this case being defined. However $main::Request is not necessarily defined during global.asa compilation or during StatINC library reloading, so this call would need to be in a subroutine for it to not error when $Request is being used. > So, it seems that there is an attempt to reload the file. Subsequent calls > to the app however use the original file and without error, until the > required file is altered again. > If you really want this file to be reloaded like an ASP script/include, you could: sub Script_OnStart { do 'citylinkweb.pl'; } or could load it similarly as an include if you wrap the code with <% %> sub Script_OnStart { $Response->Include('citylinkweb.pl'); } -- Josh _________________________________________________________________ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com 1-714-625-4051 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]