in reply to count words in a line

Question A: How many words are there on a line?
my $count = () = /\w+/g;
Question B: How many 'perlmonk' words are there on a line?
my $count = () = /\bperlmonk\b/g;
Question C: How many "perlmonk" spaced words are there on a line?
my $regex = join ('\s*', split(//, 'perlmonk')); my $count = () = /$regex/g;
In the future, please use more capitals and less superfluous punctuation. These postings, as I'm sure you're well aware, are archived for future reference. A small effort to maintain some level of quality helps everyone. As jeffa says in How (Not) To Ask A Question, the shift keys are there for a reason.