http://qs321.pair.com?node_id=42033

vaevictus has asked for the wisdom of the Perl Monks concerning the following question:

#!/usr/bin/perl -w use strict; use CGI qw/:standard/; print header; my @holder; open (FILE, "tempfile"); @holder=<FILE>; close FILE; my @theaters; my $name; my $link; my $info; my $rating; my $length; my $map; my $times; my $phone; my $mode; my $counter=-1; my $moviecounter=-1; my $internal=0; foreach my $line (@holder) { $internal++; if($line =~ m/<!-- LHS movie -->/) { //THIS IS THE LINE REPORTED A +S UNINITIALIZED. $mode ="LHS"; $moviecounter++; $internal=0; } elsif ($line =~ m/<!-- RHS movie -->/) { $mode = "RHS"; $moviecounter++; $internal=0; } elsif ($line =~ m/<!-- theater -->/) { $mode = "theater"; $counter++; $moviecounter=-1; $internal=0; } elsif ($mode eq "LHS") { if ($internal == 6 ) { ($link,$name)=$line=~m/<a href=\"(.*)\">(.*)<\/a>/; $theaters[$counter]{'movies'}[$moviecounter]{'name'}=$name; $theaters[$counter]{'movies'}[$moviecounter]{'link'}=$link; } elsif ( $internal == 7 ) { ($rating,$length)=$line=~m/<small>(.*)\&nbsp;\&nbsp;\&nbsp;(.*)< +\/small>/; $theaters[$counter]{'movies'}[$moviecounter]{'rating'}=$rating; $theaters[$counter]{'movies'}[$moviecounter]{'length'}=$length; } elsif ( $internal == 9 ) { ($times)=$line=~m/<Br>([^\&]*)/; $theaters[$counter]{'movies'}[$moviecounter]{'times'}=$times; } } elsif ($mode eq "RHS") { if ($internal == 4 ) { ($link,$name)=$line=~m/<a href=\"(.*)\">(.*)<\/a>/; $theaters[$counter]{'movies'}[$moviecounter]{'name'}=$name; $theaters[$counter]{'movies'}[$moviecounter]{'link'}=$link; } elsif ($internal == 5) { ($rating,$length)=$line=~m/<small>(.*)\&nbsp;\&nbsp;\&nbsp;(.*)< +\/small>/; $theaters[$counter]{'movies'}[$moviecounter]{'rating'}=$rating; $theaters[$counter]{'movies'}[$moviecounter]{'length'}=$length; } elsif ($internal == 7) { ($times)=$line=~m/<Br>([^\&]*)/; $theaters[$counter]{'movies'}[$moviecounter]{'times'}=$times; } } elsif ($mode eq "theater"){ if ($internal == 4 ) { ($link,$name)= $line=~m/<Br><A HREF=\"(.*)\"><b>(.*)<\/b><\/a>/; $theaters[$counter]{'link'}=$link; $theaters[$counter]{'name'}=$name; } elsif ($internal == 5) { ($info)=$line=~m/.*>(.*)/; $theaters[$counter]{'info'}=$info; } elsif ($internal == 6) { ($phone)=$line=~m/.*;(.*)/; $theaters[$counter]{'phone'}=$phone; } elsif ($internal == 7) { ($map)=$line=~m/<A HRef=\"(.*)\">/; $theaters[$counter]{'map'}=$map; } } }
Reports "Use of uninitialized value in string eq at ./m2.cgi line 31." ...

... any ideas?