This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document chomp's travels in the wonderful world of use encoding;
authorNicholas Clark <nick@ccl4.org>
Fri, 23 Jan 2004 18:03:41 +0000 (18:03 +0000)
committerNicholas Clark <nick@ccl4.org>
Fri, 23 Jan 2004 18:03:41 +0000 (18:03 +0000)
p4raw-id: //depot/perl@22199

pod/perlfunc.pod

index 54b08c8..d7912b1 100644 (file)
@@ -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