If the PATTERN contains parentheses, additional array elements are created from each matching substring in the delimiter.
Perhaps split(/,\s{0,1}/,$string) would work for you ?,
Update: I wasn't sure if you wanted to handle the comma and any amount of following spaces. split(/,\s*/,$string) if so.
In reply to Re: split strangeness
by kschwab
in thread split strangeness
by rob_au
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |