in reply to Re^4: splitting nothing?
in thread splitting nothing?

I forgot the other case where a leading empty field is discarded: a zero-width match at the beginning of the string. And I feel the split; and split ' ' case is significant enough to warrant bringing up the concept of empty leading fields there at the top, while still leaving the details of when they are preserved and when they are not to come later. That is, I am happy with how it is now (after Re^3: splitting nothing?).

If you want to submit a patch, see perlhack for instructions.

Replies are listed 'Best First'.
Re^6: splitting nothing?
by ihb (Deacon) on Jul 19, 2004 at 11:17 UTC

    bringing up the concept of empty leading fields there at the top

    This can still be done without adding another rule to how split works. My suggestion is to attack the problem from a different angle and avoid the conflict by saying something like: "in some special cases expected leading empty fields are deleted; see below". Then we don't say they should be preserved, and the conflict is avoided.

    ihb