title: How would I solve the following error "readline() on unopened filehandle ..."?
body: <p>How would I solve the following error:</p>
  
  <pre><code>readline() on unopened filehandle UPPER at faStat2 line 86.
  </code></pre>
  
  <p>in the following code?</p>
  
  <pre><code>#!/usr/bin/perl
  use strict;
  use warnings;
  
  ...
  
  my $cmd = $0;
  $cmd =~ s#.*/##;
  
  ($#ARGV &gt; 0) || die "Usage $cmd &lt;tibcoUpperMDLog&gt; &lt;tibcoLowerMDLog&gt; &lt;outFile&gt;\n\n";
  
  open(my $UPPER, $ARGV[0]) || die "Unable to open $ARGV[0]\n";
  open(my $LOWER, $ARGV[1]) || die "Unable to open $ARGV[1]\n";
  
  ...
  
  while ($msg = &lt;UPPER&gt;) { getUpperBusTimeStampAndBatchSize(\$msg); } #This is the line that the error is complaning about
  </code></pre>