title: perl : how to split?
body: <p>I have a string <code>aa:bb::cc:yy:zz</code> which needs to be split in such a way that I have an array with <code>aa:bb::cc</code>, <code>yy</code>, <code>zz</code>. i.e. I want to create two substrings from last with <code>:</code> as delimiter and remaining as a element of an array. What's the best way to achieve this?</p>
  
  <p>ex:</p>
  
  <pre><code>aa:bb::cc:yy:zz --&gt; ['aa:bb::cc','yy','zz']
  
  dd:ff:gg:dd:ee:ff:fg --&gt; ['dd:ff:gg:dd:ee','ff','gg']
  </code></pre>
  
  <p>I store IP address:port:protocol as a key in a file , and splitting wiht ":" to get IP,port,proto back and things were working fine when IP address is limited to Ipv4.  Now I want to make it ported to Ipv6 in which case IP address contains ":" so I can't get proper IP address by splitting with ":".</p>