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 somesub calls to Hybride::Module::somesub would be a pain, not to mention too much typing.

Re: Problem reloading modules

2003-08-14 Thread Jean-Sebastien Guay
Perrin, use Hybride::Projects qw(getImage other imports); 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

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 other imports); I think that's the problem. You are creating an alias to

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

Re: Problem reloading modules

2003-08-14 Thread Perrin Harkins
it pick up the change? Is there anything unusual about the way you call this sub (AUTOLOAD, function ref, etc.)? Reloading modules is not foolproof. Perl doesn't actually support it, so things like Apache::Reload fake it by removing the module from %INC and making it get compiled again

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 file

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 it

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

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::Registry be

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

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 other

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 which

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

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.

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 wrote:

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.

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

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

Re: Reloading Modules

2002-05-29 Thread Stas Bekman
Ted Prah wrote: Hi again, I'm having trouble seeing module changes when I reload a script that uses it. That's because Reload.pm doesn't re-exports the symbols when reloading the module and test.pl doesn't call import() because it sees the module in %INC, therefore it still sees the old

Re: Reloading Modules

2002-05-29 Thread Ted Prah
Thanks for the input Stats. I found your debugging methodology to be very informative and especially useful in a mod_perl environment. I tried your suggestion of commenting out require $key; in Reload.pm, but it did not work for me. I'd be happy to try any other suggestions you

Re: Reloading Modules

2002-05-29 Thread Stas Bekman
Ted Prah wrote: Thanks for the input Stats. I found your debugging methodology to be very informative and especially useful in a mod_perl environment. I tried your suggestion of commenting out require $key; in Reload.pm, but it did not work for me. I'd be happy to try any

Reloading Modules

2002-05-22 Thread Ted Prah
Hi again, I'm having trouble seeing module changes when I reload a script that uses it. I'm using Apache::Reload and my test script/module is as follows: test.pl #!/usr/local/bin/perl use strict; use warnings; use My::Test qw(:subs); print Content-type: