Hi monks.
Background
I'm writing an application server, using POE::Component::Server::HTTP (Don't have a client yet) that accepts a request; say /index?foo=bar and calls a routine in a pre-defined package; say MyDocRoot::index.
I'm not trying to duplicate mod_perl's functionality -- this is only a testing-environment/proof-of-concept.
Problem
MyDocRoot.pm is loaded at startup and works fine. My code keeps track of all loaded modules and checks the time the module was loaded against the module's file mtime. When a module changes, the code does:
do $module;With $module set to the path and filename of the module to reload. The thing does reload since I can see different output from the same request.
The trouble is, old sub-routines and variables are still defined according to what Data::Dumper on \%MyDocRoot:: shows.
I have read perlmod, perlref and various others but I have not yet found a way to reload (or unload) a module completely. I don't know where else to look. Does any monk have some wisdom/pointers to share ?
Update: Just in case, forgot to mention:
This is perl, v5.8.0 built for i386-linux-thread-multi Linux 2.4.21 i686 GNU/Linux (Debian woody)
In reply to Unloading a module completely by holo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |