Hi, monks.
I wrote kinda code reloader for a framework. Before reloading of modified code I want to "unload" already loaded code so I should clean a package. I'm doing it this way:
my $e = \%{ $package . '::' }; %$e = map { $_ => $e->{$_} } grep { /::$/ } keys %$e;
$package is the name of "unloading" package.
It works with current versions of Perl but I'm wonder is there any problem with this code that can potentially break it in future?
Thanks and sorry for my English.
In reply to What is the correct way to clear package? by vokbuz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |