Name: Anonymous 2008-02-26 0:19
I've just switched from PHP to Perl (using mod_perl for my sever) and I need help converting a script.
Here's the selection of code that's causing an error;
if (!$Database = DBI->connect('DBI:mysql:' . DB_NAME, DB_USER, DB_PASSWORD) || !$Results = $Database->prepare('SELECT ID, Title FROM Comics ORDER BY ID ASC') || !$Results->execute; )
{
my $Error = 'DB';
print 'Status: 500' . "\n";
}
Perl gives me this error message;
Can't modify logical or (||) in scalar assignment at test.pl line 25, near "->execute;"
syntax error at test.pl line 25, near "->execute;"
Execution of test.pl aborted due to compilation errors.
Anyone know what's wrong?
Thanks to any help.
Here's the selection of code that's causing an error;
if (!$Database = DBI->connect('DBI:mysql:' . DB_NAME, DB_USER, DB_PASSWORD) || !$Results = $Database->prepare('SELECT ID, Title FROM Comics ORDER BY ID ASC') || !$Results->execute; )
{
my $Error = 'DB';
print 'Status: 500' . "\n";
}
Perl gives me this error message;
Can't modify logical or (||) in scalar assignment at test.pl line 25, near "->execute;"
syntax error at test.pl line 25, near "->execute;"
Execution of test.pl aborted due to compilation errors.
Anyone know what's wrong?
Thanks to any help.