summaryrefslogtreecommitdiff
path: root/pod/perlfunc.pod
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-01-23 18:03:41 +0000
committerNicholas Clark <nick@ccl4.org>2004-01-23 18:03:41 +0000
commit442a8c128e085eacd56278a9e7cc5b0e6e864660 (patch)
treecb8ac1667b09fafea1136e0e8813f36e794ee5ac /pod/perlfunc.pod
parent0a61292d87a3ad96dcd4c6518e0d39ab9feb225d (diff)
downloadperl-442a8c128e085eacd56278a9e7cc5b0e6e864660.tar.gz
Document chomp's travels in the wonderful world of use encoding;
p4raw-id: //depot/perl@22199
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r--pod/perlfunc.pod4
1 files changed, 4 insertions, 0 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 54b08c88d4..d7912b1c35 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -661,6 +661,10 @@ You can actually chomp anything that's an lvalue, including an assignment:
If you chomp a list, each element is chomped, and the total number of
characters removed is returned.
+If the C<encoding> pragma is in scope then the lengths returned are
+calculated from the length of C<$/> in Unicode characters, which is not
+always the same as the length of C<$/> in the native encoding.
+
Note that parentheses are necessary when you're chomping anything
that is not a simple variable. This is because C<chomp $cwd = `pwd`;>
is interpreted as C<(chomp $cwd) = `pwd`;>, rather than as