in reply to Bitten by the lazy execution bug?

Shot in the dark: when you pass captured variables, try quoting them: $dbh->do( ... , "$1" , "$2" , "$3" ).

Replies are listed 'Best First'.
Re^2: Bitten by the lazy execution bug?
by Anonymous Monk on Dec 08, 2007 at 18:03 UTC
    That worked. Also, changing the code to this works:
    if (/^\s*(\S+)\s+(\S+)\s+(.+\S)\s*$/) { my $x = $3; $dbh->do('replace into reference_code values (?,?,?)',undef,$1,$ +2,$3) or die "[$1] [$2] [$3] [". $dbh->errstr ."]";
    How freaky is that? Notice 1,2,and 3 in the do call are unchanged. Take out the "my" line, instant error (and the db is unchanged). Leave it in, the program runs and the table is updated accordingly.