my $str = "here are some words"; my $count = $str =~ tr/e/e/; print "We sure do have a lot of e characters: $count\n";