develooper Front page | perl.perl5.porters | Postings from January 2019

[perl #133781] Clarify DOC for split. Section about splitting emptystring

Thread Previous | Thread Next
From:
KES
Date:
January 19, 2019 03:35
Subject:
[perl #133781] Clarify DOC for split. Section about splitting emptystring
Message ID:
rt-4.0.24-22232-1547868940-120.133781-75-0@perl.org
# New Ticket Created by  KES 
# Please include the string:  [perl #133781]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133781 >


Hi.

>Note that splitting an EXPR that evaluates to the empty string always produces zero fields, regardless of the LIMIT specified.

Please clarify what 'zero fields' mean. Is this empty string or undefined value?

print map{ defined? "YES" :"NO"} split('b', "bd"); # YESYES

print map{ defined? "YES" :"NO"} split('b', "b"); # NOTHING IS PRINTED

print map{ defined? "YES" :"NO"} split('b', ""); # NOTHING IS PRINTED


would it be better to say:

>Note that splitting an EXPR that evaluates to the empty string does not produce fields at all, regardless of the LIMIT specified.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About