I am moving a bunch of code out of the main namespace and into a new package/module. The problem is all the old code tries to directly reference subroutines and some global vars (that are in the main namespace) directly and it doesn't work now that I've moved them out of that namespace and into a new one. If I go to each sub reference and change it from mySub() to &::mySub() and go to each global var from the main namespace and change refs to it from $myMainGlobal to $::myMainGlobal it works fine. I was wondering if there was an easy way to make Perl first check the current namespace for a sub or var name but if not found as defined to then check the main namespace too? Or is my only choice in this situation to modify all the references to have a :: prefix?
Thanks.