Esteemed monks,
What am I missing here:
#!/usr/bin/perl -w
use strict;
# Also tried with this, but with no better results
use POSIX qw/locale_h/;
setlocale(LC_CTYPE, "pt_PT.ISO8859-1");
my @words = qw/ç q áãç abc/;
foreach (@words) {
$_ =~/[[:alpha:]]/
? print "$_ : OK!\n"
: print "$_ : NOT OK!\n";
$_ =~/\w+/
? print "$_ : OK!\n"
: print "$_ : NOT OK!\n";
}
Output:
ç : NOT OK!
ç : NOT OK!
q : OK!
q : OK!
áãç : NOT OK!
áãç : NOT OK!
abc : OK!
abc : OK!
Why aren't "ç", "ã" and "á" being recognized as valid alphabetic characters? How can I validate a word containing such characters?
Thank your for your attention,
Miguel