Global symbol "$dbh" requires explicit package name at bbs3.cgi line 33. Global symbol "$sth" requires explicit package name at bbs3.cgi line 34. Scalar found where operator expected at bbs3.cgi line 34, at end of line (Missing operator before ?) syntax error at bbs3.cgi line 34, near "'INSERT INTO message VALUES ('$msg" String found where operator expected at bbs3.cgi line 34, near "$msg')'" (Missing operator before ')'?) Execution of bbs3.cgi aborted due to compilation errors.
ドキュメントを改めて読んだ結果、 begin; lock table a in exclusive mode; select なんとか from a where なんとか; (select の結果に応じて)insert into a なんとか; commit; とかやって、同じ行ができないように することにしました。