gri6507 has asked for the wisdom of the Perl Monks concerning the following question:
I have an interesting dillema. Due to forces outside of my control, I have to work with existing code which has something like:
use myPackage; myPackage::foo(); myPackage::bar();
it seems like something like this should be possible, but I cannot think of an easy way to do it short of actually going through every function and creating an explicit mapping like (pseudocode):package myPackage; use strict; use myNewPackage; # magically convert myNewPackage::* to myPackage()::* # except for one function where myNewPackage::bar() needs to actually +provide myPackage::old_bas()
Does anyone have any good ideas for how to deal with this?sub myPackage::a { return myNewPackage::a(@_); } sub myPackage::b { return myNewPackage::b(@_); } sub myPackage::old_bas { return myNewPackage::bar(@_); }
thanks as always!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: creating a wrapper module for bacward compatibility
by LanX (Saint) on Apr 09, 2010 at 13:22 UTC | |
|
Re: creating a wrapper module for backward compatibility
by moritz (Cardinal) on Apr 09, 2010 at 13:21 UTC | |
|
Re: creating a wrapper module for bacward compatibility
by RatKing (Acolyte) on Apr 09, 2010 at 13:41 UTC | |
by JavaFan (Canon) on Apr 09, 2010 at 15:42 UTC | |
by LanX (Saint) on Apr 09, 2010 at 14:13 UTC | |
|
Re: creating a wrapper module for bacward compatibility
by doug (Pilgrim) on Apr 09, 2010 at 17:59 UTC |