Don't ask to ask, just ask | |
PerlMonks |
Re^2: split function not working as expectedby kcott (Archbishop) |
on Jul 28, 2015 at 03:39 UTC ( [id://1136540]=note: print w/replies, xml ) | Need Help?? |
G'day lonewolf28, If you look at the documentation for the split function, you'll see that the first argument to split is a "PATTERN". Your "PATTERN" is: zero-length-string OR zero-length-string And, with the last part being totally redundant, just: zero-length-string The output is entirely to be expected. The split documentation discusses outcomes with zero-length patterns. A better "PATTERN" would be: /[|]/ See also: Perl Regular Expressions Tutorial — Ken
In Section
Seekers of Perl Wisdom
|
|