$count = @count = $data =~ m/and/g; and it works ok