my $count=0; while ($data=~m/and/g) { ++$count }