You know you are doing too complex SQL queries... when DBI/DBD::SQLite refuses to parse the SQL statement.
The statement is simple: select a field, where it is one of a set of words:
SELECT word FROM dict WHERE word='aaaaa' OR word='bbbbb' OR word='ccccc' OR...
The first error was: parser depth of 1000 was reached.
No problem. Decided to construct a binary tree of ORs:
Now, DBD::SQLite::db prepare failed: parser stack overflow.
I think the solution is to slipt this thing in more than one query. Damn!