Forum Moderators: coopster & phranque
I have this in a small cgi file: Is there a way see if the $script varible is found, if not show a error instead of a 500 error.
if ( !(-e $script) ) { print "Error";}
to my file I now get an error 500.
if ( !(-e $script) ) { print "Content-type: text/html\n\n"; print "Error"; exit(0);} else { require "$script";}
eval "require '$script'";print "Couldn't include $script: $!" if $!;
This handles include paths as well as various errors that may arise on "require".
eval "require '$script'";
print "Couldn't include $script: $@" if $@;