in reply to checking for preloaded modules

Smudged (not too dirty, not too clean) hack is the one you suggest: wrap an eval block around the HTML::Template version, if the module's not loaded, $@ will be set, and you can just generate the 'plain ole' HTML page by hand.

But since any CPAN modules worth its salt (IMO) sets $VERSION, you should be able to test defined ($HTML::Template::VERSION) and achieve similar result. But in a way, that's dirtier than the eval {} solution because a module can be perfectly functional without setting $VERSION, so I can see an otherwise excellent coder leaving that out.

Philosophy can be made out of anything. Or less -- Jerry A. Fodor