Sure, see Sub::Installer.
In reply to Re: Sub on the fly? by chromatic in thread Sub on the fly? by pileofrogs