foreach $sourceLine (@SourceData) { chomp $sourceLine; chomp $functionName; if ($functionName =~ /$sourceLine/) {$counter++;} } #### foreach $sourceLine (@SourceData) { print "$sourcfeLine\n"; print "$functionName\n"; print "\n"; if ($functionName =~ /$sourceLine/) {$counter++;} }