title: Why does Perl read only half of lines in file?
body: <p>I want to read a file line by line and for each line split the string and print it. But the script only prints the even lines.</p>
  
  <p>File:</p>
  
  <pre><code>line1:item1
  line2:item2
  line3:item3
  line4:item4
  line5:item5
  line6:item6
  </code></pre>
  
  <p>and the script:</p>
  
  <pre><code>$FILE = "file";
  open($FILE, "&lt;", "file") or die("Could not open file.");
  
  while (&lt;$FILE&gt;) {
      my $number = (split ":", &lt;$FILE&gt;)[1];
      print $number;
  }
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>item2
  item4
  item6
  </code></pre>