in reply to counting the number of occurrances of a word using regex

The "tr///" operator only works on individual characters, not on strings. To do what you want, you need to evaluate the "m//" operator in a list (actually, array) context, and then count the elements in the resulting array, thusly:
my $str = "The quick brown fox jumped over the lazy dog"; my @the = ( $str =~ /\bthe\b/gi ); print scalar @the, $/;
That prints "2".

update: It would be clearer (I hope) to say that "tr///" treats every character in the left-hand side as a member of a character class; it cannot treat any sequence of characters as a contiguous string to be matched; only the "m//" operator (and the "s///" operator) can do that. Look carefully at the "perlop" man page for more complete descriptions of these three operators.