sub require_if_present { # So here is a trick for discovering if the module is # available (and loading it if it is). This function returns # True if the module is there and this generally sets a # flag to tell the rest of the program how to behave my($module_name,$loaded) = @_; my($module_found); $module_found = 0; eval(<<"LoadModule"); # Use require so we don't load the module if it is not there require $module_name; \$module_found = 1; LoadModule return($module_found); }