$foo=5; sub has {print "ok\n"} sub hasnt {print "no dice\n"} eval "require $foo" ? has : hasnt
prints ok
$foo="nosuchmodule"; sub has {print "ok\n"} sub hasnt {print "no dice\n"} eval "require $foo" ? has : hasnt
prints no dice
In reply to Re: Running a script if module is not installed.
by roju
in thread Running a script if module is not installed
by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |