in reply to require() on the fly

It is worthwhile to note that most of CGI's subroutines are stored as strings and compiled only on demand. If you never use redirect(), for example, then the redirect() method never has to be compiled. (This applies even for subs that you import.) While there is still some cost to creating the %SUBS hash that contains the code snippets, it's much more efficient than if CGI compiled all its code up front. So, using the CGI module for just a few functions isn't as bad as you might think.