Skip Menu |

This queue is for tickets about the Module-Reload CPAN distribution.

Report information
The Basics
Id: 67215
Status: open
Priority: 0/
Queue: Module-Reload

People
Owner: NEILB [...] cpan.org
Requestors: randomcoder1 [...] gmail.com
Cc: jpritikin [...] pobox.com
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: reload doesn't delete modules when files on disk are not present anymore
Module::Reload doesn't delete modules when files on disk are not present anymore. I wrote a small patch fixing this. -- Your bugs , they are afraid of me.
Subject: Reload.pm.patch
On Mon Apr 04 06:50:04 2011, WSDOOKADR wrote: Show quoted text
> Module::Reload doesn't delete modules when files on disk are not present > anymore. > I wrote a small patch fixing this. >
-- Your bugs , they are afraid of me.
Subject: Reload.pm.patch
--- /var/www/home/qchess/perl5/lib/perl5/Module/Reload.pm 2011-04-04 11:45:11.000000000 +0300 +++ Reload.pm 1998-08-20 19:40:05.000000000 +0300 @@ -12,11 +12,7 @@ $Stat{$file} = $^T unless defined $Stat{$file}; warn "Module::Reload: stat '$file' got $mtime >? $Stat{$file}\n" - if $Debug >= 3; - unless (-f $file) { - delete $INC{$file}; - delete $INC{$key}; - }; + if $Debug >= 3; if ($mtime > $Stat{$file}) { delete $INC{$key}; eval {
Hi, Show quoted text
> > Module::Reload doesn't delete modules when files on disk are not present anymore.
I'm not convinced that this is the right thing to do. A script might have been running for a while, and if we included your patch, then if a module were removed, then the script could bomb out, after running fine for a good while. Obviously this is a bit of an edge case anywhere: a module getting deleted while there's code running that's using it. But I think in this (unlikely) scenario, the right thing to do is not delete the module. Let's say it was deleted because someone was installing a new version with UNINST=1, and we happen to catch things where the old module has gone, but the new one isn't there: in this case, not deleting it will let the script keep running, and if we check again, then we'll see the new version and reload that. Neil