in reply to Renaming a module
One possibility is to alias the symbol from one package to another.
package Pileofrogs::Util; *{"Pileofrogs::Frob::frob"} = \*{"Pileofrogs::Util::frob"}; sub frob { print "frob!"; } package main; Pileofrogs::Frob->frob; Pileofrogs::Util->frob;
Another way is to just change the original sub to one that calls the new one. You can also use this to emit a warning.
package Pileofrogs::Frob; use Carp 'carp'; sub frob { carp "You should really use Pileofrogs::Util::frob"; Pileofrogs::Util->frob( @_ ); }
|
|---|