I remember reading in the camel book how one ought to be careful about using || vs. 'or' when used in conjuction with list operators (or subs without parenthesis).
i.e.
use
open FILE, ">$file" or die "Oops";
or
open (FILE, ">$file") || or die "Oops";
but not
open FILE, ">$file" || or die "Oops";
So, I'm a guessing that you need to change line 30 to (note additional parenthesis) ...
or maybe change the || to 'or'$sth->execute() || die "Could not execute SQL statement ... maybe inva +lid?\n$!";
Let me know if I guessed right (or even if I guessed wrong).$sth->execute or die "Could not execute SQL statement ... maybe invali +d?\n$!";
Sandy
Quote from the camel book:
As lower precedence alternatives to &&, ||, and !, Perl proveds the and, or, and not operators. The behaviour of these operators is identical -- in particular, and and or short-ciruit like their counterparts, which makes them useful not only for logical expressions but also for control flow.
Since the precedence of these operators is much lower than the ones borrowed from C, you can safely use them after a list operator without the need for parentheses:
With the C-style operators you'd have to write it like this:unlink "alpha", "beta", "gamma" or gripe (), next LINE;
unlink("alpha", "beta", "gamma") || (gripe(), next LINE);
In reply to Re: DBI::ODBC Delete Error
by Sandy
in thread DBI::ODBC Delete Error
by vbrtrmn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |