in reply to Running a script if module is not installed

I'm not sure why that doesn't work. I will recommened against using the & notation if at all possible. The following works for me (cygwin 5.8).

$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