title: How to handle special characters in perl pie find replace
body: <p>I have the following text in a file:</p>
  
  <pre><code>prompt **********************************************************************************
  prompt **  Start
  prompt **********************************************************************************
  prompt **
  prompt **  Calling:  FILE
  prompt **
  prompt **
  @@FOLDER\FILE
  prompt **
  prompt **  commit
  commit;
  prompt **
  prompt **
  prompt **
  prompt **********************************************************************************
  prompt **  End
  prompt **********************************************************************************
  </code></pre>
  
  <p>When I do </p>
  
  <pre><code>$ perl -pi -e "s/FILE/$file/g" ./tmp.sql;
  </code></pre>
  
  <p>It replaces all instances of the word FILE with whatever I have in $file, but when I call </p>
  
  <pre><code>$ perl -pi -e "s/FOLDER/$folder/g" ./tmp.sql;
  </code></pre>
  
  <p>Which just has the folder string, it coughs up, doesn't replace anything and the shell where I am calling it from spits out this stuff:</p>
  
  <pre><code>Execution of -e aborted due to compilation errors.
  Unquoted string "g" may clash with future reserved word at -e line 1.
  Unknown regexp modifier "/R" at -e line 1, at end of line
  Unknown regexp modifier "/F" at -e line 1, at end of line
  Unknown regexp modifier "/5" at -e line 1, at end of line
  Unknown regexp modifier "/4" at -e line 1, at end of line
  Unknown regexp modifier "/7" at -e line 1, at end of line
  Unknown regexp modifier "/5" at -e line 1, at end of line
  Unknown regexp modifier "/6" at -e line 1, at end of line
  Unknown regexp modifier "/_" at -e line 1, at end of line
  Unknown regexp modifier "/2" at -e line 1, at end of line
  </code></pre>
  
  <p>Anyone know what gives?</p>