title: perl splitting a string
body: <p>I realize that I did not make the title good enough, but I am not getting any better.</p>
  
  <p>Assume there is a string </p>
  
  <pre><code>$str = "(aa)(bb)(cc)(dd)(ee)";
  </code></pre>
  
  <p>That is, there are substrings, enclosed in parenthesis, there is no space between the parenthesis groups, i.e. like (<em>)(</em>), but inside the parenthesis, where i wrote aa, bb, cc, etc, there can be spaces. Parenthesis may be nested, but that is not absolutely important. but there are unknown number of parenthesis groups.</p>
  
  <p>Now I want to split the string in an array of strings, each element having a (balanced) parenthesis enclosed element . that is,</p>
  
  <pre><code># @arr contains now ("(aa)", "(bb)", "(cc)" .. etc)
  </code></pre>
  
  <p>of course i can implement a counter based method, but wont perl, being perl, have some built in methods for this? I dont quite know how this particular operation called, so i dont know what to look for, string splitting is too general, no?</p>
  
  <p>edit: splitting parentheses delimmited string in perl &lt;--- searching this is not returning me anything useful, i guess this is due to the fact it is not really DELIMITED, enclosed?</p>