Skip to content

Commit

Permalink
Correct equivalent for split without a pattern (#3988)
Browse files Browse the repository at this point in the history
* Correct equivalent for split without a pattern

In Perl, split without a pattern is different from split "" — telling users of the former to switch to the latter changes from splitting by words to splitting by characters.

* Update 5to6-perlfunc.pod6

* Update 5to6-perlfunc.pod6
  • Loading branch information
Smylers committed Dec 4, 2021
1 parent 2ea6db7 commit aa2ccc2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/Language/5to6-perlfunc.pod6
Expand Up @@ -1935,8 +1935,10 @@ also now works as a method: C<"a;b;c".split(';')>
=item split
The zero argument version must now be called with an explicit empty string, as
described above.
C<split> now requires a pattern. For the equivalent of Perl's behaviour
of splitting on whitespace when no pattern is specified, use
L<words|/routine/words> (or use C<split> with C</\s+/> as the pattern
and C<:skip-empty> as a named argument).
X<| sprintf - perlfunc>
=head2 sprintf
Expand Down

0 comments on commit aa2ccc2

Please sign in to comment.