#!/usr/bin/perl -w # $module is the module you're checking for $module = "DBI"; eval("require $module") ? &run() : &runwithout; sub run { print "Installed\n"; use DBI; } sub runwithout { print "Not Installed\n"; }
20030710 Edit by Corion: Added CODE tags
In reply to Running a script if module is not installed by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |