On Jan 18, 2006, at 1:18 AM, Jonathan Scott Duff wrote:

On Tue, Jan 17, 2006 at 12:35:57PM -0500, Mark Reed wrote:
On 2006-01-17 12:24 PM, "Gaal Yahas" <[EMAIL PROTECTED]> wrote:
[split on empty string] doesn's seem to be specced yet.

I would prefer the current pugs behavior; it's consistent with the general case, in which a string which does not match the splitting regex results in a single-item list containing the original string. This is the Python
behavior.

I find the Perl5 (and, surprisingly, Ruby) behavior rather counterintuitive.

FWIW, I agree with Mark.

-Scott

Just to show opposite, I've always found that behavior (i.e. returning the original string unchanged) confusing. C<split> works based on sequential examination of the target string to locate matching substrings on which to split. There is a matching "empty string" substring between every character. Naturally, what you get back is an array of characters.

Plus, it's a useful idiom.

--Dks

Reply via email to