title: take array input from user in Perl
body: <p>When i'm using this code </p>
  
  <pre><code>print "\nEnter !0 numbers \n\n";
  @arr=&lt;STDIN&gt;;
  chomp @arr;
  </code></pre>
  
  <p>It goes on taking inputfrom user until i use <code>ctrl+z</code> and then press enter. I want to limit the number of user input to the list.
  For that I have tried </p>
  
  <pre><code>print "\nEnter !0 numbers \n\n";
  for($i=0;$i&lt;10;$i++)
  {
  @arr[$i]=&lt;STDIN&gt;;
  chomp @arr;
  } 
  </code></pre>
  
  <p>But this aging fall in into infinite loop and i have to use <code>ctrl+c</code></p>
  
  <p>How can i Limit my loop so that only 10 input user will enter </p>