Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 524 forks source link

perlfunc: fix split example with limit higher than number of splits #22151

Closed haarg closed 2 weeks ago

haarg commented 2 weeks ago

When calling split with a LIMIT higher than the number of possible output fields, no extra fields will be produced. The previous example trying to demonstrate this had an error because it used an empty match, which meant a final empty string could be produced.

Fixes #22150

Grinnz commented 2 weeks ago

This is a more useful example to common split usage anyway.