in reply to Count number of occurrence of word

Hi, try this:
my $count = $string =~ s/word/word/g;

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.