Two days ago, I was having the same issues. My testing script is a bit more elaborate, but confirms your problem: \w does not work under use locale, whatever the locale is. If you need locale, use posix classes or unicode character properties (provided your locale is unicode based).
Discussion on the details can be found in perlunicode and perllocale, but the relevant paragraphs are quite different in each version of Perl.