title: Perl How to use array store input strings
body: <p>User first enter a number of lines. It then reads n lines of text from user input, and prints these lines backwards, i.e., if n=5, it prints the 5th
   line first, the 4th,  …, and the 1st,line last. I don't think wrong in my code, but when i start enter lines(line end with a newline), it won't stop. my array can store infinite number of lines which cause the problem stop them </p>
  
  <pre><code>use strict;
  use warnings;
  
  print "Enter number of n \n";
  my $n = &lt;STDIN&gt;;
  print "Enter couple lines of text \n";
  my @array = (1..$n);
  @array=&lt;STDIN&gt;;
  do{
  print "$array[$n]";
  $n--;
  
  }until($n=0);
  </code></pre>