title: Perl Regex 'e' (eval) modifier with s///
body: <p>I'm having a little trouble comprehending this simple use of the /e regex modifier.</p>
  
  <pre><code>my $var = 'testing';
  $_ = 'In this string we are $var the "e" modifier.';
  
  s/(\$\w+)/$1/ee;
  
  print;
  </code></pre>
  
  <p>Returns: "In this string we are testing the "e" modifier."</p>
  
  <p>I cannot see why two 'e' modifiers are required.  As far as I can see, $1 should capture '$var' from the string and a single 'e' modifier should then be able to replace the variable with its value.  I must be misunderstanding something however, since trying the above code with just one 'e' modifier does not visibly replace anything in the string.</p>
  
  <p>Excuse me for asking such a simple question!</p>
  
  <p>Thanks.</p>