title: How to re-direct the contents to a file instead of printing it to terminal
body: <p>How to avoid printing the contents to terminal (As it will take more time if it is 20k lines in my case) and instead redirect it to a file in perl?</p>
  
  <p>This is just a sample and not the entire code:</p>
  
  <pre><code> if ($count eq $length)
                  {
                      push(@List,$line);
                      print "$line\n"; #Prints line to terminal which is time consuming
                  }
  </code></pre>
  
  <p>I tried below but it did not work</p>
  
  <pre><code>if ($cnt eq $redLen)
                      {
                          push(@List,$line);
                          print $line &gt; "/home/vibes/text";
                      }
  </code></pre>
  
  <p>Please let me know if my question is not clear?</p>