Try looking at the AUTOLOADER facility.
In reply to Re: Dynamic Subroutines by mzedeler in thread Dynamic Subroutines by Anonymous Monk