in reply to Re^2: DBI mysql substring_index syntax error
in thread DBI mysql substring_index syntax error

Yes, which means that you don't need interpolation and that you could use a differfent quoting mechanism.

I can't test it, but using q instead of qq with your original string should probably be sufficient. Or you could possibly use the quotemeta function to get the escaping right.