# split BEFORE a ( or AFTER a ) my @s = split /(?=\()|(?<=\))/; push @results, \@s; ### that even lets you get away with leaving out @s push @results, [ split /(?=\()|(?<=\))/ ];