And, I see, I will leave after this comment, since I do not know Perl. But I would believe that the editor is right by highlighting $ q as a constant. I assume that you need to concatenate the value into a string, and not just refer to the variable. So, I assume that if + is used to concatenate strings in perl, then use something like:
my $ sql = qq {SELECT a, b, c FROM t WHERE Lower (a) LIKE '} + $ q + qq {'};
(Note: If the language is not tightly integrated with a database, such as Oracle / PLSQL, you usually need to create a fully valid SQL string before sending it to the database, rather than expecting the compiler to “interpolate” / “Replace” the value of the variable .)
I would again suggest that you get COUNT () from the instructions to make sure that you are comparing an apple with apples.
source share