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
It dl_closes the associated .so file if the module was DynaLoaded.

A module could have inserted things into other packages, and other modules may have added other things into the current package, and unload_module won't undo those and will overundo the others. So may be it's better to call it unload_stash?

Isn't that an understatement of what the function does ?

It's good that the name is not end user friendly (i.e. requires the knowledge of perl internals), since people shouldn't be using it, unless they know what they are doing.

Definetely. There are very few reasons why one would want to use something like that. And we still know that as much as I might want to, _unloading_ a Perl module isn't 100% feasible, really ;-(

--
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to