title: perl foreach eat all array content
body: <p>The follow code will eat content in @populations</p>
  
  <pre><code>@populations=("EUR","AFR","ASN","AMR");
  print @populations,"\n";  #will show EURAFRASNAMR
  foreach (@populations)
  {  
      $filepath="tmp.txt"; #whatever text file you like 
      open(FILE,"&lt;$filepath");
      while(&lt;FILE&gt;)
      {   
      }   
  }   
  print @populations,"\n";   #will print nothing
  </code></pre>
  
  <p>if change to</p>
  
  <pre><code>foreach $i (@populations)
  </code></pre>
  
  <p>then the array will not be eaten.</p>
  
  <p>or if mark the while loop, the array will not be eaten.</p>
  
  <p>I am not a perl guru, but have several years experience.</p>
  
  <p>can anyone tell me why? is it a bug of perl? </p>