Hi Gerald

my last try... i'm not very lucky in helping in this list...

> This is the actual code except for the "xxxx":
>
>  [...]
>   my $sth = $dbh->prepare( $sql ) or die $dbh->errstr if $dbh->err;

Maybe this expression is the reason (combination of 'or' and 'if').

Example code:
===
my $no_error=0; # the wanted case :-)

my $a="i_am_defined" or die "i died!" if $no_error;

print defined $a ? "defined" : "not defined";
===
# this prints:

not defined

===

I think the expression 
my $a="i_am_defined" or die "i died!"
is only evaluated if 
$dbh->err is false. 

I think you could just write:

my $sth = $dbh->prepare( $sql ) or die $dbh->errstr;

(omitting "if $dbh->err")

>[...]

greetings joe

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to