foreach $sourceLine (@SourceData) { if ($functionName =~ /$sourceLine/) {$counter++;} }