diff options
author | Karl Williamson <khw@cpan.org> | 2022-07-02 10:50:42 -0600 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2022-07-07 13:05:43 +1000 |
commit | 966f9a3ba28de67807c4b44b8af6f012bb216fb9 (patch) | |
tree | 8cb45f129d9226a55c309794f8aba981f12f4dd0 /pod/perlunicode.pod | |
parent | df033c44911e6291d6d0b3652809a11776a02dea (diff) | |
download | perl-966f9a3ba28de67807c4b44b8af6f012bb216fb9.tar.gz |
perlunicode: Clarify user-defined properties
Diffstat (limited to 'pod/perlunicode.pod')
-rw-r--r-- | pod/perlunicode.pod | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod index 39fe99c368..4efa22243a 100644 --- a/pod/perlunicode.pod +++ b/pod/perlunicode.pod @@ -1177,13 +1177,15 @@ C<\p{}> or C<\P{}> construct. if ($txt =~ /\p{IsForeign}+/) { ... } -Note that the effect is compile-time and immutable once defined. -However, the subroutines are passed a single parameter, which is 0 if +The subroutines are passed a single parameter, which is 0 if case-sensitive matching is in effect and non-zero if caseless matching is in effect. The subroutine may return different values depending on -the value of the flag, and one set of values will immutably be in effect -for all case-sensitive matches, and the other set for all case-insensitive -matches. +the value of the flag. But the subroutine is never called more than +once for each flag value (zero vs non-zero). The return value is saved +and used instead of calling the sub ever again. If the sub is defined +at the time the pattern is compiled, it will be called then; if not, it +will be called the first time its value (for that flag) is needed during +execution. Note that if the regular expression is tainted, then Perl will die rather than calling the subroutine when the name of the subroutine is |