Change 31793 by [EMAIL PROTECTED] on 2007/09/05 10:49:06

        Subject: Re: perlfunc.pod/split; concerning trailing fields
        From: Father Chrysostomos <[EMAIL PROTECTED]>
        Date: Tue, 4 Sep 2007 14:40:24 -0700
        Message-Id: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/pod/perlfunc.pod#573 edit

Differences ...

==== //depot/perl/pod/perlfunc.pod#573 (text) ====
Index: perl/pod/perlfunc.pod
--- perl/pod/perlfunc.pod#572~31684~    2007-08-07 07:47:35.000000000 -0700
+++ perl/pod/perlfunc.pod       2007-09-05 03:49:06.000000000 -0700
@@ -5418,14 +5418,22 @@
 
 produces the output 'h:i: :t:h:e:r:e'.
 
-Empty leading (or trailing) fields are produced when there are positive
-width matches at the beginning (or end) of the string; a zero-width match
-at the beginning (or end) of the string does not produce an empty field.
-For example:
+Empty leading fields are produced when there are positive-width matches at
+the beginning of the string; a zero-width match at the beginning of
+the string does not produce an empty field. For example:
 
    print join(':', split(/(?=\w)/, 'hi there!'));
 
-produces the output 'h:i :t:h:e:r:e!'.
+produces the output 'h:i :t:h:e:r:e!'. Empty trailing fields, on the other
+hand, are produced when there is a match at the end of the string (and
+when LIMIT is given and is not 0), regardless of the length of the match.
+For example:
+
+   print join(':', split(//,   'hi there!', -1));
+   print join(':', split(/\W/, 'hi there!', -1));
+
+produce the output 'h:i: :t:h:e:r:e:!:' and 'hi:there:', respectively,
+both with an empty trailing field.
 
 The LIMIT parameter can be used to split a line partially
 
End of Patch.

Reply via email to