title: Perl "\my $var" why is the "my" escaped with a backslash?
body: <p>I was looking at some sample code for making and removing file paths using File::Path.</p>
  
  <p><a href="http://perldoc.perl.org/File/Path.html" rel="nofollow">http://perldoc.perl.org/File/Path.html</a></p>
  
  <p>I can get the functions to work fine but I have had some difficulty getting the error messaging to work right.  In the example for capturing error messages they use a <code>\</code> before the <code>my</code>.  What is the purpose of this <code>\</code>?</p>
  
  <pre><code># Sample code from the link above
  remove_tree( 'foo/bar', 'bar/rat', {error =&gt; \my $err} );  # why escape the my?!?!
  if (@$err) {
      for my $diag (@$err) {
          my ($file, $message) = %$diag;
          if ($file eq '') {
              print "general error: $message\n";
          }
          else {
              print "problem unlinking $file: $message\n";
          }
      }
  }
  else {
      print "No error encountered\n";
  }
  </code></pre>
  
  <p>I have never seen this before and I can't find an explanation anywhere.  I tried removing the <code>\</code> and I get a syntax error so clearly it is needed, but why?</p>