summaryrefslogtreecommitdiff
path: root/pod/perlrebackslash.pod
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2014-03-26 12:07:39 +0000
committerDavid Mitchell <davem@iabyn.com>2014-03-26 12:07:39 +0000
commit37ea023e4dd4082193ed4d0b88f61693ce4eb5b1 (patch)
tree29b18eb6400513540bd978f933b81be111be166b /pod/perlrebackslash.pod
parente14119056960dbe28537c9870667b5b920d9d731 (diff)
downloadperl-37ea023e4dd4082193ed4d0b88f61693ce4eb5b1.tar.gz
Deprecate /\C/
For 5.20, just say its deprecated. We'll add a warning in 5.22 and change its behaviour in 5.24.
Diffstat (limited to 'pod/perlrebackslash.pod')
-rw-r--r--pod/perlrebackslash.pod10
1 files changed, 5 insertions, 5 deletions
diff --git a/pod/perlrebackslash.pod b/pod/perlrebackslash.pod
index b7eb4fd6b8..5d458b5bdc 100644
--- a/pod/perlrebackslash.pod
+++ b/pod/perlrebackslash.pod
@@ -69,7 +69,7 @@ as C<Not in [].>
\b Word/non-word boundary. (Backspace in []).
\B Not a word/non-word boundary. Not in [].
\cX Control-X.
- \C Single octet, even under UTF-8. Not in [].
+ \C Single octet, even under UTF-8. Not in []. (Deprecated)
\d Character class for digits.
\D Character class for non-digits.
\e Escape character.
@@ -575,11 +575,14 @@ categories above. These are:
=item \C
-C<\C> always matches a single octet, even if the source string is encoded
+(Deprecated.) C<\C> always matches a single octet, even if the source
+string is encoded
in UTF-8 format, and the character to be matched is a multi-octet character.
This is very dangerous, because it violates
the logical character abstraction and can cause UTF-8 sequences to become malformed.
+Use C<utf8::encode()> instead.
+
Mnemonic: oI<C>tet.
=item \K
@@ -652,9 +655,6 @@ Mnemonic: eI<X>tended Unicode character.
=head4 Examples
- "\x{256}" =~ /^\C\C$/; # Match as chr (0x256) takes
- # 2 octets in UTF-8.
-
$str =~ s/foo\Kbar/baz/g; # Change any 'bar' following a 'foo' to 'baz'
$str =~ s/(.)\K\g1//g; # Delete duplicated characters.