yoda54 has asked for the wisdom of the Perl Monks concerning the following question:
#!/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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Running a script if module is not installed
by sgifford (Prior) on Jul 10, 2003 at 16:50 UTC | |
|
Re: Running a script if module is not installed
by tall_man (Parson) on Jul 10, 2003 at 16:51 UTC | |
|
Re: Running a script if module is not installed.
by roju (Friar) on Jul 10, 2003 at 20:54 UTC |