Why do you want to build your SQL queries using hard coding strings, and then make a replacement for them? Is it something like
my $proto_query = <<'EOQ'
select ... where %s ...
EOQ
my $query = sprintf $proto_query, 'users.fake = -1 AND ...';
(, , ) , Data::Phrasebook::SQL make ?
, , , -
my $foo = "foo bar where baz where moo";
$foo =~ s/(.*)where/$1where affe and/;
say $foo;
, , , "where", , , , , , , .
, , SQL-. , SQL - . , , select ... where user.name = 'where'.