I have a perl -cgi script in which I need to test something based on when cgi_error() happens. Could some one please let me know under what scenario cgi_error() function gets invoked. I tried below
- changed owner and permissions on the script
But that has not helped so far.
This is code snippet
use CGI qw(-compile :standard);
.....
if (cgi_error()) {
...
}
It would be great if some one can explain when cgi_error() is invoked automatically in the script.
The
cgi_erroris not called “automatically”. However, depending on the circumstances, it will return information to see if something went wrong.From the CGI documentation:
and
and