in reply to split on the pattern of '),('
On examining your input, it's possible you'll get more mileage from either a state machine character-wise parser, a regular expression, or my favorite in this context, multiple operations including a different basic split. Since you appear to be separating tuples, you could use my @arr = split /(?<=\))\s*,\s*(?=\()/, $str; to separate the tuples, and then deal with each one individually.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|