Stas Bekman wrote:
Philippe M. Chiasson wrote:
Stas Bekman wrote:
After looking at the doc again, I think it's misleading to call this function unload_module. Since it's doesn't undo what the module has loaded. It unloads a specific stash (package name) no more and no less.
It's not quite that simple, it gets rids of a module in preparation for reloading it (eval "use $module").
It clears the module's stash It removes the module from %INC
oh i've missed that one. in fact remember that a module could be autovivified from anywhere. So make sure that it handles the case when you don't have a real module Foo/Bar.pm but you do have sub Foo::Bar::test inserted from another place.
Well, if you call unload_module("Foo::Bar") it will wipe out sub Foo::Bar::test {}
and fail to find Foo/Bar.pm in %INC and leave it alone.
perfect.
and please add that to the doc too.
Not sure what you want to see in there ?
That it attempts to remove Foo/Bar.pm from %INC when unload_module("Foo::Bar") is called. This is not obvious and better be documented.
Right, so not _stash, but neither _module. even Symbol calls it delete_package which is probably much closer, but still doesn't cover.
clean_namespace() clear_namespace() clean_package() clear_package()
I like clear_package(), clear_module() maybe ?
I'd go with the package, module may contain more than one package and therefore misleading. unload_package or clear_package sounds good. I think unload_package is a good choice.
-- __________________________________________________________________ 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]
