in reply to creating a wrapper module for bacward compatibility

Would one not be able to do something like this:

package mypackage; use base mynewpackage;

This should make mypackage have all the functions that mynewpackage has, at least this is what I would try...

I have no idea about performance though but it might be interesting to see if this can out perform Autoload I think it should be able to.

Replies are listed 'Best First'.
Re^2: creating a wrapper module for bacward compatibility
by JavaFan (Canon) on Apr 09, 2010 at 15:42 UTC
    This should make mypackage have all the functions that mynewpackage has, at least this is what I would try.
    Are you sure? According to its manual page, base sets up an ISA relationship. Which means that mypackage inherits the methods from mynewpackage. Which is fine if the subs are called as methods, but the OP has to deal with myPackage::foo() calls. He needs mypackage to import from mynewpackage instead.
Re^2: creating a wrapper module for bacward compatibility
by LanX (Saint) on Apr 09, 2010 at 14:13 UTC
    the sub-names are not always identical (old_bas->bar) and he will sometimes need more flexibility.

    For instance for extra logic or even for extra error handling and testing to stabilize this "bridge".

    Overall this is not trivila and should be handled with care and foresight...

    Cheers Rolf