in reply to POSIX character classes in regular expressions

I don't quite understand the distinction either, but locales come in here too.

I've done this quick check:

for l in C hu_HU de_DE; do echo $l:; LANG=$l perl -we 'use locale; for + $s ("\x{e1}", "\x{151}", "\x{a3}") { for $r (qr/\w/, qr/[[:alnum:]]/ +, qr/\pL/) { printf qq["\\x{%x}" %s /%s/\n], ord($s), ($s =~ qr/$r/) ? "=~" : "!~", $r; } }'; done
output is
C: "\x{e1}" !~ /(?-xism:\w)/ "\x{e1}" !~ /(?-xism:[[:alnum:]])/ "\x{e1}" =~ /(?-xism:\pL)/ "\x{151}" =~ /(?-xism:\w)/ # why? "\x{151}" =~ /(?-xism:[[:alnum:]])/ # why? "\x{151}" =~ /(?-xism:\pL)/ "\x{a3}" !~ /(?-xism:\w)/ "\x{a3}" !~ /(?-xism:[[:alnum:]])/ "\x{a3}" !~ /(?-xism:\pL)/ hu_HU: "\x{e1}" =~ /(?-xism:\w)/ "\x{e1}" =~ /(?-xism:[[:alnum:]])/ "\x{e1}" =~ /(?-xism:\pL)/ "\x{151}" =~ /(?-xism:\w)/ "\x{151}" =~ /(?-xism:[[:alnum:]])/ "\x{151}" =~ /(?-xism:\pL)/ "\x{a3}" =~ /(?-xism:\w)/ "\x{a3}" =~ /(?-xism:[[:alnum:]])/ "\x{a3}" !~ /(?-xism:\pL)/ de_DE: "\x{e1}" =~ /(?-xism:\w)/ "\x{e1}" =~ /(?-xism:[[:alnum:]])/ "\x{e1}" =~ /(?-xism:\pL)/ "\x{151}" =~ /(?-xism:\w)/ "\x{151}" =~ /(?-xism:[[:alnum:]])/ "\x{151}" =~ /(?-xism:\pL)/ "\x{a3}" !~ /(?-xism:\w)/ "\x{a3}" !~ /(?-xism:[[:alnum:]])/ "\x{a3}" !~ /(?-xism:\pL)/

With no locale;, you get the same output as with with the C locale.