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); } }