BEGIN { eval { use CGI; }; if ($@) { print "failed\n"; } else { print "use CGI worked\n"; } }