title: How can I count the amount of spaces at the start of a string in Perl?
body: <p>How can I count the amount of spaces at the start of a string in Perl?</p>
  
  <p>I now have:</p>
  
  <pre><code>  $temp = rtrim($line[0]);
    $count = ($temp =~ tr/^ //);
  </code></pre>
  
  <p>But that gives me the count of all spaces.</p>