in reply to Re: Error: Use of uninitialized value $item in concatenation (.) or string at...
in thread Error: Use of uninitialized value $item in concatenation (.) or string at...
Amazing! You're definitely right... I think I have to restructure, all the elements have to stay together. But the all-encompassing if-clauses won't help until I make each sent. number and it's sentence and all the grammar functions one large string...
But if I were to use the push method, the same error persists if I don't put defined??:foreach my $line (@lines) { print "$line\n\n"; ##TEST ONLY## foreach my $verbform (@verbforms) { my $one_match_ref = []; #Chpt. num (Could check %seens): if ($line =~ /^Parsing file: (chpt\d+_\d+).txt/) { #$one_match_ref->[0] = $1 ; ##Only once in file push( @{$one_match_ref}, $1 ); } if ($line =~ /\b$verbform\b/i) { #Sent. num: #SentSentences: if ($line =~ /^Parsing \[(sent. \d+) len. \d+\]: \[(.+)\] +/) { #$one_match_ref->[1] = $1; ##Multiple in file #$one_match_ref->[2] = $2; #$one_match_ref->[2] =~ s/,//g; my $nocomma_sent = $2; $nocomma_sent =~ s/,//g; push( @{$one_match_ref}, $1, $nocomma_sent); } #Dependencies: if ($category_id eq "all") { if ($line =~ /subj\w*\(|obj\w*\(|prep\w*\(|xcomp\w*\(| +agent\w*\(|purpcl\w*\(|conj_and\w*\(/) { if ($line =~ /(\w+)\((\w+)\-\d+\,\s(\w+)\-\d+\)/) +{ #$one_match_ref->[3] = $1; #$one_match_ref->[4] = $2; #$one_match_ref->[5] = $3; push( @{$one_match_ref}, $1, $2, $3 ); } } } } # add the reference of match into array. push (@all_matches, $one_match_ref); } }
|
|---|