Every time I run this script with warnings on I get a warning that the variable $location is undeclared once for each line in the @workingdata array and I don't understand why. It appears to use "0" in the pattern match because it never matches any line which it would if it used "".{ while (my ($location, $devices) = each %devicecount) { foreach my $line (@workingdata) { my @Fld = split /,/, $line; if (/${location}TEXT/) { $somevar += $Fld[11]; $someothervar += $Fld[12] } } printf OUTPUT "some stuff from the info we gathered"; } }
In reply to uninitialized variable warning by vatheck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |