title: Why does this print 12 times?
body: <p>I am learning Perl's multithreading. My code:</p>
  
  <pre><code>use warnings;
  use threads;
  use threads::shared;
  
  $howmany = 10;
  $threads = 5;
  
  $to = int($howmany / $threads);
  
  for (0 .. $threads) {$trl[$_] = threads-&gt;create(\&amp;main, $_);}
  for (@trl) {$_-&gt;join;}
  
  sub main {
      for (1 .. $to) {
          print "test\n";
      }
  }
  
  exit(0);
  </code></pre>
  
  <p>I want to print the word <em>test</em> <code>$howmany</code> times in <code>$threads</code> threads.
  This code prints <em>test</em> 12 times. Where is the problem?</p>