Geoffrey Young wrote:
Or you can (simply put) "delete $Foo::Bar::{'Baz::'};". Deleting the entire stash from that package.
Sounds cool, but I'd first check with p5p whether they think it's safe. I think stashes contain all kind of things you might want to keep. If it was that simple why do you think Doug haven't used this technique in first place. It's possible that it's just an inertia of something that existed before but we should investigate the safety of this technique first.
Ideally I want to see a core perl API to accomplish that w/ tests, and then have us backport it to support in older perls. That way we can be sure that if Perl adds some new things into the stash, we won't wipe them accidently. But may be it's not needed. I want to see what p5p says first.
You have added a very basic test, so it's hard to tell whether things really working w/o having lots of other tests to cover more cases, where a stash has CODE, IO, GLOB entries and other packages cross-referencing things in the package that's getting deleted.
One more thing, you said that crossreferenced things won't get deleted. But I'm not sure this is right. Since when the module is reloaded it'll have new references and the system will be in the incosistent state, as old things will still be hanging around. But I think this the case with the current implementation as well.
Other thing I haven't quite checked yet is the effect of this on a XS package, calling
bootstrap() a second time might end up 'leaking' a .so file. More on this later.
May be on delete it should simply get the xs handle of the loaded .so and unload it? Then there will be no leak?
-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
