sub processComparison { # INCOMING COMPARISON-COLUMN DETAILS my ( $table, #MAIN COLUMN NAME $ACCP_searchver1, #COMPARISON COLUMN NAMES/SELECTIONS $ACCP_searchver2, $ACCP_searchver3, $ACCP_searchver4, $ACCP_comp1, #ORIGINAL USER-ENTERED QUERY $ACCP_comp2, $ACCP_comp3, $ACCP_comp4, $ACCP1_regex, #USER SELECTION FOR REGEX vs. SIMPLE MATCH $ACCP2_regex, $ACCP3_regex, $ACCP4_regex, $accpyn1, #USER SELECTION FOR MATCH/NO MATCH $accpyn2, $accpyn3, $accpyn4 ) = @_; # INCOMING ARRAY my $regex1 = &composeRegex($ACCP1_regex,$ACCP_comp1); my $regex2 = &composeRegex($ACCP2_regex,$ACCP_comp2); my $regex3 = &composeRegex($ACCP3_regex,$ACCP_comp3); my $regex4 = &composeRegex($ACCP4_regex,$ACCP_comp4); my @main = &getTableFC($table); my @crosscheck1 = &getTableFC($ACCP_searchver1) if ($regex1); my @crosscheck2 = &getTableFC($ACCP_searchver2) if ($regex2); my @crosscheck3 = &getTableFC($ACCP_searchver3) if ($regex3); my @crosscheck4 = &getTableFC($ACCP_searchver4) if ($regex4); my $linecount=0; my ($line, $line1, $line2, $line3, $line4) = ('','','','',''); foreach $line ( @main ) { $line1 = $crosscheck1[$linecount]; $line2 = $crosscheck2[$linecount]; $line3 = $crosscheck3[$linecount]; $line4 = $crosscheck4[$linecount]; $line =~ s/^\s+|\s+$//; chomp $line; $line1 =~ s/^\s+|\s+$//; chomp $line1; $line2 =~ s/^\s+|\s+$//; chomp $line2; $line3 =~ s/^\s+|\s+$//; chomp $line3; $line4 =~ s/^\s+|\s+$//; chomp $line4; my ($r1,$r2,$r3,$r4) = (0,0,0,0); #USING THESE TO TALLY MATCHES # CHECK REGEX MATCHES FOR COMPARISON COLUMNS if ($regex1) { $r1++; if ($accpyn1) { if ($line1 =~m/$regex1/) { $r1++ } } else { if ($line1 !~ m/$regex1/) { $r1++ } } }; if (($regex2) && ($r1!=1)) { $r2++; if ($accpyn2) { if ($line2 =~m/$regex2/) { $r2++ } } else { if ($line2 !~ m/$regex2/) { $r2++ } } }; if (($regex3)&&($r1!=1)&&($r2!=1)) { $r3++; if ($accpyn3) { if ($line3 =~m/$regex3/) { $r3++ } } else { if ($line3 !~ m/$regex3/) { $r3++ } } }; if (($regex4)&&($r1!=1)&&($r2!=1)&&($r3!=1)) { $r4++; if ($accpyn4) { if ($line4 =~m/$regex4/) { $r4++ } } else { if ($line4 !~ m/$regex4/) { $r4++ } } }; # LINE UP MATCH RESULTS TALLIES if ( ($r1!=1) && ($r2!=1) && ($r3!=1) && ($r4!=1) ) { #PASSED COMPARISON FILTER #DO CODE TO FORMAT & RETURN $line FOR MAIN COLUMN } } # end foreach $line } #END SUB processComparison