Help for this page

Select Code to Download


  1. or download this
    $foo=5;
    sub has {print "ok\n"}
    sub hasnt {print "no dice\n"}
    
    eval "require $foo" ? has : hasnt
    
  2. or download this
    $foo="nosuchmodule";
    sub has {print "ok\n"}
    sub hasnt {print "no dice\n"}
    
    eval "require $foo" ? has : hasnt