You may use some
code in %INC trickery to (try to) install some modules (if not already available) and return filehandles to them. See e.g.
Re: Using a module more than once for a very trivial example of such trickeries, and the following node for a pointer to the relevant documentation.