in reply to Problem with a multi-line regexp

If you are using the regex first on "thisquery=select \\", then on " table1.column1, \\", then on " table1.column2, \\", etc., it will never match because it never sees both "select" and "table1.column3".

Try:

perl -pi -we '/select/ .. s/table1\.column3/DUMMY_ID/'
which will do the substitution for the first table1.column3 found on or after each select line.

Also, \1, \2, etc. are better written as $1, $2, etc. on the right side of a substitution., as you would have been told if you'd enabled warnings.