XP is just a number | |
PerlMonks |
Re: Matching dot using regexpby huck (Prior) |
on Oct 09, 2017 at 18:46 UTC ( [id://1201035]=note: print w/replies, xml ) | Need Help?? |
I had to think for a bit as to why it was undefined rather than '' split notes "If LIMIT is omitted (or, equivalently, zero), then it is usually treated as if it were instead negative but with the exception that trailing empty fields are stripped (empty leading fields are always preserved);"
Result
Without the -1 any char is a delimiter, and there are no "fields" between delimiters, so all are stripped. With the -1, while all are delimiters and there are no "fields" between delimiters, each delimiter returns an empty field.
In Section
Seekers of Perl Wisdom
|
|