use warnings; use strict; my $str = "The quick brown fox jumps over the lazy dog"; my $count = ($str =~ tr/(the)//); print "$count\n";