I want to backslash a variable automatically so that the end users don't need to type the backslashes for a Perl regex string replacement.
API_URI="http://something/api"
FIND="(API_URI)(.*?[\=])(.*?[\'](.*?[\']))"
REPLACE="\\1\\2 \'$API_URI\'"
perl -pi -e "s/${FIND}/${REPLACE}/" file.ext