how about for starters:
my @list = qw(a b c d e f g h i j k l m n o p q r s t u v w x y z); my $result= getsection([EMAIL PROTECTED],20,10); for( @{ $result }) { print "-$_-\n"; }
sub getsection {
my @newa = ();
my ($aref,$strt,$amnt) = @_;
return undef if ref($aref) ne 'ARRAY' || $strt !~ m/^\d+$/ || $amnt !~ m/^\d+$/;
my $last = scalar(@{ $aref }); $last--; my $begn = 0; for( $strt .. (($strt + $amnt) - 1) ) { if($_ <= $last) { push @newa, $aref->[$_]; } else { push @newa, $aref->[$begn];$begn++; } } return [EMAIL PROTECTED]; }
Doh! Of course there was a shorter sexxier way!
Jenda and Gunnar, you always rock! ;p
Lee.M - JupiterHost.Net
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
