my $count = 0; $count += map /$substring/g, @array;