if (defined eval "require My::Module") { print "all's well\n"; } else { print "nope, figure out a workaround\n"; }
But is this likely to be too harsh? There are other conditions that could cause require to fail besides "Can't locate My/Module.pm in xxx".
Suggestions appreciated,
-Jason
In reply to Best way to check for installed module by jmay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |