my $str = "The quick brown fox jumps over the lazy dog"; my $count = () = $str =~ m/(the)/ig; print $count; #### my $str = "There are three theatres in the town"; my $count = () = $str =~ m/(\bthe\b)/ig; print $count; #### my $str = "The quick brown fox jumps over the lazy dog"; my $count = () = $str =~ m/(\bthe\b)/ig; print $count;