title: Perl read line by line
body: <p>I have a simple Perl script to read a file line by line. Code is below. I want to display two lines and break the loop. But it doesn't work. Where is the bug?</p>
  
  <pre><code>$file='SnPmaster.txt';
  open(INFO, $file) or die("Could not open  file.");
  
  $count = 0; 
  foreach $line (&lt;INFO&gt;)  {   
      print $line;    
      if ($++counter == 2){
        last;
      }
  }
  close(INFO);
  </code></pre>