SPUG: Change a namespace after loading?

Bill Warner billw at onedrous.org
Wed Apr 11 16:51:17 PDT 2007

The idea is to implement phased deprecation of old code.

The situation: a library with hundreds and hundreds of clients (modules 
that 'use' the library) is to be deprecated.

The solution: write a new version that looks identical to the clients. 
Simple enough, but I don't want to switch all clients to the new code 
simultaneously. I'd prefer to switch a few at a time. In other words, for 
some clients the old version is used, for the rest the new version is 

On Wed, 11 Apr 2007, Yitzchak Scott-Thoennes wrote:

> On Wed, April 11, 2007 3:44 pm, Bill Warner wrote:
>> I want to change the namespace of a class after it's been loaded. Worse,
>> I
>> want to continue to use the original namespace, but fill it with new code
>> that might refer to the old code in the changed namespace. Wore still, I'd
>> rather not edit the old code at all. I want to import it as I've always
>> done, but into a new namespace.
>> Is there technique or a module for this purpose?
> There are several things you can do, but all with some limitation or
> drawback.  Can you explain what you are really trying to get done?
> (See http://perlmonks.org/?node=XY+Problem.) There's likely a better
> way.

More information about the spug-list mailing list