http://www.perlmonks.org?node_id=1024305


in reply to Re: Perl and Mysql logs
in thread Perl and Mysql logs

Hi and thank you for the reply.

The clientpreno is a voluntary mistake, so that the system will generate a Mysql error. Otherwise, the Perl script gets executed without generating any error. The purpose is to be able to get Mysql errors when there is an error in the code. Actually, I am not able to debug the Mysql code in Perl, because it doesn't generate any Mysql error when the script is called from a browser. If it's called from root, I get the Mysql error. If it's called from root with a chroot, I still get the error.

Called from root:

perl /httpd/domainname/cgi/testerreur.pl DBD::mysql::st execute failed: Unknown column 'clientpreno' in 'field +list' at /httpd/domainname/cgi/testerreur.pl line 22.

Called from root with a chroot:

chroot /httpd perl /httpd/domainname/cgi/testerreur.pl DBD::mysql::st execute failed: Unknown column 'clientpreno' in 'field +list' at /httpd/domainname/cgi/testerreur.pl line 22.

Called from a browser (results from the Apache logs):

No errors in the logs and the page is shown in the browser.

Just like I said in the previous post, if I make a Perl error, I get the usual "Premature end of script headers".

Thanks