in reply to Running a script if module is not installed

You're basically right; you just want to wrap the use part in an eval block. You don't have to use a string, and not using a string will be a little bit faster. Something like:
#!/usr/bin/perl -w use strict; eval "use DBI"; if ($@) { runwithout(); } else { run(); }

Update: Looks like you do need to use a string to get the effect you want. Above code has been updated. Also added use strict