#!/usr/bin/perl -w use strict; my $count = 0; $count += /\band\b/g while <>; print "$count\n";