my $start = (get starting number from your input); for ($start..$start+10) { (do things with $array[$_]); }