in reply to checking for preloaded modules
You could probably use the %INC hash. This contains a list of all of the modules that have been loaded. The keys are the names of the modules and the values are the paths that the modules were loaded from.
if ($INC{'HTML/Template.pm'}) { # do HTML::Template stuff } else { # do vanilla HTML stuff }
Update: Corrected hash key. Thanks to jmcnamara for pointing it out (twice!)
--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
|
|---|