in reply to On-the-fly module replacements : On topic - really

Re-loading the code is easy: with delete $INC{Your/Module.pm}; require Your::Module you can achieve that.

But that doesn't preserve any lexical or package variable from disappearing in the mean time. If there were no important informations, you can just re-initialize the module. Otherwise you might want to try PadWalker to recover the lexical variables. But I don't know if that can also set variables in foreign scopes, and I don't know how well it plays with closures.

Of course that doesn't tell you how to handle the down time in between, and frankly I have no idea about it. Hopefully others can help you there.

Replies are listed 'Best First'.
Re^2: On-the-fly module replacements : On topic - really
by perrin (Chancellor) on Nov 19, 2008 at 18:04 UTC
    There's no down time in between, at least with processes, since they all have their own %INC. Not sure if all threads have their own or not.