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