in reply to Repeated 'require's
If you store the modification time of $SOURCE in a variable, you can save one filetest per check. Otherwise, it looks like code I've written. (You can also disable just the redefine warning.)
I don't believe there is a leak, but say that with two caveats. First, in a mod_perl environment, you're going to write to copied-on-write pages. Each child process will have to load the new module, and that will take up previously-shared memory. Second, if there are any code references to functions in the reloaded package, they might not behave as you'd expect. I wouldn't be surprised if they leaked a little, but I'm not quite sure they do.
|
|---|