summaryrefslogtreecommitdiff
path: root/pod/perlop.pod
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-04-28 09:31:16 -0600
committerKarl Williamson <public@khwilliamson.com>2011-05-18 11:15:08 -0600
commitd813941f8a2ed4bd4ce76bd185773b1551dc01d6 (patch)
treef383ed82414d88c7f265874590ca946bb187fff4 /pod/perlop.pod
parentde25ec475131e36403f73934903aa34a8d4dc2e4 (diff)
downloadperl-d813941f8a2ed4bd4ce76bd185773b1551dc01d6.tar.gz
perlop: Add explanation of \c
Diffstat (limited to 'pod/perlop.pod')
-rw-r--r--pod/perlop.pod8
1 files changed, 6 insertions, 2 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod
index 8cd21430c9..4f18f9edc3 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -1104,6 +1104,10 @@ table:
\c^ chr(30)
\c? chr(127)
+In other words, it's the character whose code point has had 64 xor'd with
+its uppercase. C<\c?> is DELETE because C<ord("@") ^ 64> is 127, and
+C<\c@> is NULL because the ord of "@" is 64, so xor'ing 64 itself produces 0.
+
Also, C<\c\I<X>> yields C< chr(28) . "I<X>"> for any I<X>, but cannot come at the
end of a string, because the backslash would be parsed as escaping the end
quote.
@@ -1116,8 +1120,8 @@ sequences mean on both ASCII and EBCDIC platforms.
Use of any other character following the "c" besides those listed above is
discouraged, and some are deprecated with the intention of removing
those in Perl 5.16. What happens for any of these
-other characters currently though, is that the value is derived by inverting
-the 7th bit (0x40).
+other characters currently though, is that the value is derived by xor'ing
+with the seventh bit, which is 64.
To get platform independent controls, you can use C<\N{...}>.