Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: How to Split on specific occurrence of a commaby swl (Parson) |
on Dec 03, 2020 at 21:35 UTC ( [id://11124602]=note: print w/replies, xml ) | Need Help?? |
The limit arg to split lumps the rest of the string into the last array entry. If you want n items, then split with a limit of n+1 and ignore or discard the last entry in the array. Your code was also using a map to create an array ref, which is not needed here. This updated snippet from your example code will give an array of two items:
In Section
Seekers of Perl Wisdom
|
|