I have a legacy piece of perl code that uses perl DBI with constructs like
$db->bind_param(1, $some_blob, {TYPE => SQL_BLOB});
where SQL_BLOB is a bareword. I would like to use strict pragma in the same file, but it then complains about the bareword. ('Bareword "SQL_BLOB" not allowed while "strict subs" in use') Can I somehow exempt this line from strict checking?
The strict pragma is lexical
and it can also be turned off within a scope. So
Edit
However, the above will only tolerate the bareword while bind_param still won't know what that (integer constant) is. This is solved by
import
-ing such constant(s), by using the:sql_types
import tag; see DBI Constants. That is anyway a far superior way to satisfy thestrict
.Thanks to Andy Lester for bringing this up, see their answer