From: Nicholas Clark Date: Fri, 23 Jan 2004 18:03:41 +0000 (+0000) Subject: Document chomp's travels in the wonderful world of use encoding; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=442a8c128e085eacd56278a9e7cc5b0e6e864660;p=p5sagit%2Fp5-mst-13.2.git Document chomp's travels in the wonderful world of use encoding; p4raw-id: //depot/perl@22199 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 54b08c8..d7912b1 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 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 is interpreted as C<(chomp $cwd) = `pwd`;>, rather than as