/p{Mirrored} fails

/p{Mirrored} fails

am 18.02.2009 16:08:14 von Bob Hallissy

the following works as expected:
my $s = 'Hi (There)';
foreach (split(//, $s))
{
print "$_ ", ($_ =~ m/^\p{Lu}$/ ? 'IS' : 'IS NOT'), " Lu.\n";
}

but trying to do the same thing for the Mirrored property:
my $s = 'Hi (There)';
foreach (split(//, $s))
{
print "$_ ", ($_ =~ m/^\p{Mirrored}$/ ? 'IS' : 'IS NOT'), " Mirrored.\n";
}

generates the following error message:
Can't find Unicode property definition "Mirrored" at test.pl line 4

perldoc perlunicode says "Many predefined properties are available,
such as \p{Mirrored} and \p{Tibetan}."

perl -v:
This is perl, v5.10.0 built for MSWin32-x86-multi-thread
(with 5 registered patches, see perl -V for more detail)
Copyright 1987-2007, Larry Wall
Binary build 1004 [287188] provided by ActiveState http://www.ActiveState.com
Built Sep 3 2008 13:16:37

I'm pretty sure this worked on 5.8. Any help would be appreciated

Bob
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: /p{Mirrored} fails

am 18.02.2009 16:27:37 von Bill Luebkert

Bob Hallissy wrote:
> the following works as expected:
> my $s = 'Hi (There)';
> foreach (split(//, $s))
> {
> print "$_ ", ($_ =~ m/^\p{Lu}$/ ? 'IS' : 'IS NOT'), " Lu.\n";
> }
>
> but trying to do the same thing for the Mirrored property:
> my $s = 'Hi (There)';
> foreach (split(//, $s))
> {
> print "$_ ", ($_ =~ m/^\p{Mirrored}$/ ? 'IS' : 'IS NOT'), " Mirrored.\n";
> }
>
> generates the following error message:
> Can't find Unicode property definition "Mirrored" at test.pl line 4
>
> perldoc perlunicode says "Many predefined properties are available,
> such as \p{Mirrored} and \p{Tibetan}."
>
> perl -v:
> This is perl, v5.10.0 built for MSWin32-x86-multi-thread
> (with 5 registered patches, see perl -V for more detail)
> Copyright 1987-2007, Larry Wall
> Binary build 1004 [287188] provided by ActiveState http://www.ActiveState.com
> Built Sep 3 2008 13:16:37
>
> I'm pretty sure this worked on 5.8. Any help would be appreciated

Doesn't work on 5.8 - I think it's a typo. A little farther down it lists:

Scripts
The script names which can be used by "\p{...}" and "\P{...}", such as in
"\p{Latin}" or "\p{Cyrillic}", are as follows:

Arabic
Armenian
Bengali
Bopomofo
Buhid
CanadianAboriginal
Cherokee
Cyrillic
Deseret
Devanagari
Ethiopic
Georgian
Gothic
Greek
Gujarati
Gurmukhi
Han
Hangul
Hanunoo
Hebrew
Hiragana
Inherited
Kannada
Katakana
Khmer
Lao
Latin
Malayalam
Mongolian
Myanmar
Ogham
OldItalic
Oriya
Runic
Sinhala
Syriac
Tagalog
Tagbanwa
Tamil
Telugu
Thaana
Thai
Tibetan
Yi
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs