for(grep /base/i, (keys %{*your::})) { *{"us::$_"} = \*{"your::$_"}; undef *{"your::$_"}; }