in reply to Golf: Count unique words

Looks like you checking for the frequency of words in a file. In that case, the 2 \b in your regex aren't really necessary.

s/(\w+)/$w{$1}++;$t++;$1;/eg while (<>);