in reply to Code efficiency / algorithm
I am getting this strange error:
Use of uninitialized value at parse.pl line 48, <datafile2> chunk 1474 +2.
Line 48 is if ($_ eq $year) { in the code below
It seems to work fine and all of a sudden I keep getting this error displayed on the screen *shrug*.
The code that it is complaining about is:
while (<datafile2>) { chomp; my $line = $_; next if /^$/; next if /^\D.*$/; my ($date, $year) = /^((\d{4})\d+)/; foreach my $name (sort keys %corps) { for my $id (sort keys %{ $corps{$name} }) { $_ = $id; s/(\d{4}).*/$1/; if ($_ eq $year) { if (($date gt $corps{$name}{$id}{bid}) && ($date lt $c +orps{$name}{$id}{eid})) { print "Line $. => CorpName: $name Date=$date is +in RangeId: $id -> $corps{$name}{$id}{bid} - $corps{$name}{$id}{eid}" +; print OUT "$.,$line"; } } } } }
Did I reach some limit? datafile2 is 80+MB... 367,000 or so lines...
Cheers,
David
|
|---|