title: Perl claims uninitialized value on a variable that was set from an array
body: <p>I'm not sure why its doing this, but it is. I have a project i'm working on for keeping score, and saving it to text/data files. it also will show information saved in a file, and a few other goodies. Right now, i have a set of code that i'm trying to get working. I have the file set so that it automatically runs a certain sub, but i'm trying to trigger the sub that shows data. I run the script using <code>perl scorecard.pl --display-file scores.dat</code>, and i get the following:</p>
  
  <pre><code>    Use of uninitialized value $gn in print at scorecard.pl line 30.
      Use of uninitialized value $gt in print at scorecard.pl line 30.
      Use of uninitialized value $gp in print at scorecard.pl line 30.
      Game '' was started  with  players.
      these were the scores:
      Use of uninitialized value $gp in numeric lt (&lt;) at scorecard.pl line 31.
      Died at scorecard.pl line 35.
      Welcome to scorecard
      A simple scorecard script
  
      What game would you like to score?
      ^C
  </code></pre>
  
  <p>Here's the code for the display sub:</p>
  
  <pre><code>    sub dispfile()
      {
          my ($opt_name, $dfile) = @_;
          open (my $fhd,'&lt;',$dfile)
           or die "Could not open file '",$dfile,"'.\n";
          chomp(my @ls = &lt;$fhd&gt;);
          my $gt = $ls[0];
          my $gn = $ls[1];
          my $gp = $ls[2];
          print "Game '",$gn,"' was started ",$gt," with ",$gp," players.\nthese were the scores:\n";
          for(my $i=3;$i&lt;$gp;$i++){
              print $ls[$i];
              }
          close $fhd;
          die;
          }
  </code></pre>
  
  <p>The whole project is currently on my github, and i have pushed the latest version to my dev-0.1-r2 branch: <a href="https://github.com/rvzm/scorecard/blob/dev-0.1-r2/scorecard.pl" rel="nofollow noreferrer">GitHub - scorecard.pl</a></p>