PDA

View Full Version : perl / Mysql script suddenly died



astd_cascadia
12-02-2009, 07:29 PM
We have a number of perl scripts that access Mysql databases. All were running fine until the recent Bluehost upgrade to perl 5.8.8. Every one of them now dies with a 500 error. I'm a newbie, but managed to troubleshoot using Hello World fragments, and found that the
use Mysql;
command now chokes the script.

The script below works without that line, 500's with it:
#!/usr/bin/perl
use CGI
use Mysql;

print "Content-type: text/html\n\n";
print "<html><title>test</title><body bgcolor=\"#FFFFFF\">";

print "Hello World";

print "</body></html>";
exit(0);

I'm thinking that there's a configuration issue in our account or something similar. I did check to make sure out databases were intact, and they are. I suspect it's something really obvious and simple, so I naturally wouldn't recognize it! Any help would be gratefully received.

Thanks,
Brian

Adam
12-03-2009, 03:03 AM
This may just be a typo, but you're missing the ";" on your "use CGI" line.

Are you certain this "Mysql" module is installed on your server, as I don't think it's included in Perl's base (in favor of DBI (http://search.cpan.org/dist/DBI/DBI.pm) [CPAN]). If you installed it through the "Perl Modules" link in your cPanel, you'll need to pre-pend the code on that page to your script so it correctly modifies your @INC array.

astd_cascadia
12-03-2009, 11:44 AM
Thanks, Adam. The missing semicolon was a typo, but our perl let it go by(!).

I think you're right on with the thought that Mysql isn't there anymore. Why it should have disappeared suddenly is a mystery. I've opened up a support ticket -- seems reasonable when BlueHost changed something and we didn't.

Best,
Brian