title: Can somebody explain the tr /d modifier in perl?
body: <p>I found this example in a Perl tutorial, but could not understand the output. The tutorial says:</p>
  
  <blockquote>
    <p>The /d modifier deletes the characters matching SEARCHLIST that do not have a corresponding entry in REPLACEMENTLIST.</p>
  </blockquote>
  
  <p>but I could not figure out how this is realized in the example.</p>
  
  <p>Can somebody explain how the output was generated? </p>
  
  <p>Script:</p>
  
  <pre><code>$string = 'the cat sat on the mat.';
  $string =~ tr/a-z/b/d;
  print "[$string]\n";
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>[ b b   b.]
  </code></pre>
  
  <p>(The square brackets mark the start and end of the string, that's all.)</p>