in reply to Locale Woes...
Then, once you know the file really is stored with utf8 encoding, you need to add use utf8; at the top of the script. That tells the perl interpreter that string literals in the script should have the utf8-flag turned on (and are expected to contain wide characters).
The following version of your code works for me (v5.8.6 built for darwin-thread-multi-2level) -- note that your script was missing a semicolon on the "setlocale" line, but in fact, you don't even need to worry about locale in order for the match to work.
If you'll be doing something else in the real script that requires locale settings, that's a separate issue. Regex matches and other character-based operations depend only on the utf8 flag settings of scalars, not on locale.use utf8; my $suspect = "vähicule"; if($suspect =~ /^\w+$/) { print STDERR "MATCHES\n"; }
|
|---|