diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-05-12 08:45:40 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-05-12 08:45:40 +0000 |
commit | de5763b09f57cd1553a966128894c602f4a35b8e (patch) | |
tree | 53b1b5c6ae8d91c65a41276ad383e9c64dcd15b5 /pod | |
parent | 52ea55c9ee04ef3b03dd13373eda27b47fea1087 (diff) | |
download | perl-de5763b09f57cd1553a966128894c602f4a35b8e.tar.gz |
Rework documentation of split(//,...)
p4raw-id: //depot/perl@24450
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlfunc.pod | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index d7b9bfa683..a428b5f655 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -5077,15 +5077,14 @@ characters at each point it matches that way. For example: produces the output 'h:i:t:h:e:r:e'. -Using the empty pattern C<//> specifically matches the null string, and is -not be confused with the use of C<//> to mean "the last successful pattern -match". So, for C<split>, the following are equivalent: +As a special case for C<split>, using the empty pattern C<//> specifically +matches only the null string, and is not be confused with the regular use +of C<//> to mean "the last successful pattern match". So, for C<split>, +the following: print join(':', split(//, 'hi there')); - print join(':', split('', 'hi there')); - -and they produce the output 'h:i: :t:h:e:r:e'. +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 |