title: limiting the size of an array?
body: <p>Suppose we have the following code :</p>
  
  <pre><code>#!usr/bin/perl
  
  use strict ;
  use warnings ;
  
  
  
  sub print_ele_arr{
  
  my @arr = &lt;STDIN&gt; ;
  #print the elements of the array here . 
  #do something else ..
      }
  print_ele_arr() ;
  </code></pre>
  
  <p>but i want to store just 3 elements from the user's input into my @arr array , how to do that , in general how to limit the size of a given array ?</p>