Re: Problem reloading modules

2003-08-14 Thread Perrin Harkins
On Thu, 2003-08-14 at 11:24, Jean-Sebastien Guay wrote: > I'm using Apache::Reload, and I can see that my modified module is > getting reloaded (with ReloadDebug On), but the program still uses the > old code. How can you tell? Can you post some sample code? You might be doing something that doe

Re: Problem reloading modules

2003-08-14 Thread Stas Bekman
Perrin Harkins wrote: If you're interested in working on it, we could discuss possible approaches on the list and review your patch. In a week or so I'll have a bit more free time, and I might try implementing it. I'll start by reading up on mod_perl internals... :-) I'd suggest a different appr

Re: Problem reloading modules

2003-08-14 Thread Jean-Sebastien Guay
> However, there will always be things that Apache::Reload doesn't > handle. For example, you might import functions from one module into > another module, as opposed to importing into a Registry script. Well, making a given module aware of who imported it (whether it's a module or a Registry scr

Re: Problem reloading modules

2003-08-14 Thread Perrin Harkins
On Thu, 2003-08-14 at 15:33, Jean-Sebastien Guay wrote: > In a week or so I'll have a bit more free time, and I might try > implementing it. I'll start by reading up on mod_perl internals... :-) Actually, all you need to read is the code for Apache::Registry or ModPerl::Registry (depending on whic

Re: Problem reloading modules

2003-08-14 Thread Jean-Sebastien Guay
> How can you tell? Can you post some sample code? You might be doing > something that doesn't work when reloaded, like closures. Well, here's the code I'm trying to run. (I have verified that Param('script_root') returns D:/htdocs, as expected). The initial code was this: <

Re: Problem reloading modules

2003-08-14 Thread Jean-Sebastien Guay
Hi Perrin, > I don't see anything wrong with that chunk of code. If you restart the > server, does it pick up the change? Yes. > Is there anything unusual about the > way you call this sub (AUTOLOAD, function ref, etc.)? Not at all. It is imported with use Hybride::Projects qw(getImage ); a

Re: Problem reloading modules

2003-08-14 Thread Jean-Sebastien Guay
Stas Bekman wrote: > > OK, I've written a proper entry for the man page, Jean-Sebastien can you > > please verify that it all works, as I wrote it without testing. Great work Stas, you're quick :-) Other than the little mistake Perrin pointed out, the suggested change works. Perrin Harkins wrot

Re: Problem reloading modules

2003-08-14 Thread Perrin Harkins
On Thu, 2003-08-14 at 15:10, Stas Bekman wrote: > OK, I've written a proper entry for the man page, Jean-Sebastien can you > please verify that it all works, as I wrote it without testing. Thanks. > http://perl.apache.org/docs/2.0/api/Apache/Reload.html#Problems_with_Scripts_Running_with_Registry_

Re: Problem reloading modules

2003-08-14 Thread Stas Bekman
Perrin Harkins wrote: On Thu, 2003-08-14 at 15:10, Stas Bekman wrote: OK, I've written a proper entry for the man page, Jean-Sebastien can you please verify that it all works, as I wrote it without testing. Thanks. http://perl.apache.org/docs/2.0/api/Apache/Reload.html#Problems_with_Scripts_Runni

Re: Problem reloading modules

2003-08-14 Thread Stas Bekman
Stas Bekman wrote: Perrin Harkins wrote: On Thu, 2003-08-14 at 14:29, Jean-Sebastien Guay wrote: I'm asking you to try it and see if it works. Ok, I tried it and it works. I guess we need to add this to the docs: Apache::Reload will have problems if you import subs from a module you are tryin

Re: Problem reloading modules

2003-08-14 Thread Perrin Harkins
On Thu, 2003-08-14 at 15:01, Jean-Sebastien Guay wrote: > Could something in Apache::Registry be implemented to integrate it > better with Apache::Reload? Something along the lines of keeping track > of which modules a certain script use()s, and at request time, checking > if Apache::Reload has rel

Re: Problem reloading modules

2003-08-14 Thread Jean-Sebastien Guay
Perrin, > Apache::Registry? Just do a touch on the script file and Registry will > reload it. OK, thanks. > You could hack your own Apache::RegistryNG subclass that > would just reload everything when Apache::Reload triggers, but it's > probably not worth it. Could something in Apache::Registr

Re: Problem reloading modules

2003-08-14 Thread Stas Bekman
Perrin Harkins wrote: On Thu, 2003-08-14 at 14:29, Jean-Sebastien Guay wrote: I'm asking you to try it and see if it works. Ok, I tried it and it works. I guess we need to add this to the docs: Apache::Reload will have problems if you import subs from a module you are trying to reload. The probl

Re: Problem reloading modules

2003-08-14 Thread Perrin Harkins
On Thu, 2003-08-14 at 14:29, Jean-Sebastien Guay wrote: > > I'm asking you to try it and see if it works. > > Ok, I tried it and it works. I guess we need to add this to the docs: Apache::Reload will have problems if you import subs from a module you are trying to reload. > The file that imports

Re: Problem reloading modules

2003-08-14 Thread Jean-Sebastien Guay
> I'm asking you to try it and see if it works. Ok, I tried it and it works. > A possible solution if that is the problem is to make all the modules > that import it reload as well. You can do that with a touch file. The file that imports it is not a module, it's the actual script. No other fi

Re: Problem reloading modules

2003-08-14 Thread Perrin Harkins
On Thu, 2003-08-14 at 11:43, Jean-Sebastien Guay wrote: > And I can see in the error_log that $image is still the absolute path > ("D:/htdocs/images/project/prefix/bob.jpg" in our example) even after > the change. I don't see anything wrong with that chunk of code. If you restart the server, does

Problem reloading modules

2003-08-14 Thread Jean-Sebastien Guay
Hello, I know this has been discussed before, but I can't seem to find the information I need to solve my problem. I'm using Apache::Reload, and I can see that my modified module is getting reloaded (with ReloadDebug On), but the program still uses the old code. I have read http://perl.apache.or

Re: Problem reloading modules

2003-08-14 Thread Perrin Harkins
On Thu, 2003-08-14 at 13:41, Jean-Sebastien Guay wrote: > > Is there anything unusual about the > > way you call this sub (AUTOLOAD, function ref, etc.)? > > Not at all. It is imported with > > use Hybride::Projects qw(getImage ); I think that's the problem. You are creating an alias to the sub

Re: Problem reloading modules

2003-08-14 Thread Jean-Sebastien Guay
Perrin, > > use Hybride::Projects qw(getImage ); > > I think that's the problem. You are creating an alias to the sub here, > and when it gets reloaded the alias is still pointing to an old version. Actually, I just saw that the sub is exported in the EXPORT section of the Projects module, not t

Re: Problem reloading modules

2003-08-14 Thread Perrin Harkins
On Thu, 2003-08-14 at 14:04, Jean-Sebastien Guay wrote: > > Try doing a fully-qualified sub call instead of importing. > > Err, that would actually be a pretty massive change to my codebase. > Changing all the calls to Hybride::Module:: would be > a pain, not to mention too much typing. There has