List Info

Thread: Userdefined properties




Userdefined properties
user name
2007-09-07 11:38:47
Two changes for the section about user defined properties. 
First is that the string returned by the IsFoo function may
contains a single Unicode point. Second, it removes the
remark
that the source string has be marked as having Unicode
characters.
This is not true. p{} and P{} *always* have Unicode
semantics:

    $ perl -wE 'say "Yes 1" if "xFF" =~
/w/'
    $ perl -wE 'say "Yes 2" if "xFF" =~
/p/'
    Yes 2

And for user defined properties:

    #!/usr/bin/perl

    use strict;
    use warnings;

    use Test::More tests => 2;

    sub IsFoo {<<"--"}
    F0 FF
    --

    ok "xF9" =~ /p/;
    ok "x79" =~ /P/;

    __END__
    1..2
    ok 1
    ok 2


--- pod/perlunicode.pod.orig	2007-09-07 18:24:35.000000000
+0200
+++ pod/perlunicode.pod	2007-09-07 18:27:41.000000000 +0200
 -754,6
+754,10 
 
 =item *
 
+A single hexadecimal number denoting a Unicode code point
to include.
+
+=item *
+
 Two hexadecimal numbers separated by horizontal whitespace
(space or
 tabular characters) denoting a range of Unicode code points
to include.
 
 -844,10
+848,6 
 It's important to remember not to use "&" for
the first set -- that
 would be intersecting with nothing (resulting in an empty
set).
 
-A final note on the user-defined property tests: they will
be used
-only if the scalar has been marked as having Unicode
characters.
-Old byte-style strings will not be affected.
-
 =head2 User-Defined Case Mappings
 
 You can also define your own mappings to be used in the
lc(),
Re: Userdefined properties
user name
2007-09-08 07:40:31
On 07/09/2007, Abigail <abigailabigail.be> wrote:
>
> Two changes for the section about user defined
properties.

Thanks, applied as #31818.

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )