Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 19th, 2012  |  syntax: Perl  |  size: 0.33 KB  |  views: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. sub getIncs{
  2.     my @$bar = shift;
  3.     my %incs;
  4.     my $inccount = 0;
  5.     my $i=0;
  6.     while($i<@bar-1){
  7.         for($j=$i; 1; $j++;){
  8.             if($bar[$j] == $bar[$j+1]+1){
  9.                 $incs{$inccount} = ($i,$j);
  10.             } else {
  11.                 $inccount++;
  12.                 last;
  13.             }
  14.         }
  15.     }