in reply to Running a script if module is not installed

See the Perl Cookbook, section 12.2 "Trapping Errors in require or use". The eval of the require is good, but then you could just run import for the module if it works (also make sure to run in a BEGIN block).
BEGIN { my $mod = "DBI"; if (eval "require $mod") { $mod->import(); # Set flags, etc. } else { # Set flags, etc. here. } }