title: Perl: find the last occurrence of the char "\"
body: <p>I want to strip the path from a file string like this:</p>
  
  <pre><code>Root\ToOrganization\Service_b37189b3-8505-4395_Out_BackOffice.xml
  </code></pre>
  
  <p>I am trying to find the index of the last occurrence of "\" so I can use substring up to there.</p>
  
  <p>but I can't use the char "\" in the search. I am using "\" instead, but its not working...</p>
  
  <p>my code i am trying : </p>
  
  <pre><code>$file = "Root\ToOrganization\Service_b37189b3-8505-4395_Out_BackOffice.xml";
  $tmp = rindex($file, "\\");
  print $tmp;
  </code></pre>
  
  <p>the OUTPUT I'm getting:</p>
  
  <pre><code>-1
  </code></pre>
  
  <p>What can I do?</p>