SPUG: Change a namespace after loading?

Bill Warner billw at onedrous.org
Fri Apr 13 14:56:58 PDT 2007


I don't want to edit the clients, nor do I want to edit the deprecated
code. I want to load the deprecated code and change its namespace then
write some new code that dispatches to the deprecated code in the
altered namespace.

I'm thinking Safe.pm will do it.

Eric Wilhelm wrote:
> # from Bill Warner
> # on Wednesday 11 April 2007 04:51 pm:
>
>   
>> 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 used.
>>     
>
> Why does that require messing with namespaces at runtime?  Is this a 
> single, persistent environment?  Seems that {local @INC = ("newcode/", 
> @INC); require Module;} would do the trick in most situations.
>
> --Eric
>   



More information about the spug-list mailing list