title: how to transform an array of integers into regions in perl?
body: <p>I now have an integer array like,
  (1,13,3,5,6,7,11,10,8,2,12)
  and I want to get the consecutive sub-regions form this array,
  the results of above array should be (1,3), (5,8), (10,13)</p>
  
  <p>The array maybe very large. Do anybody have any ideas?</p>
  
  <p>Thanks a lot. </p>