in reply to Next 50 array elements during each loop?

Hi

This is how you approach that , start a new file

#!/usr/bin/perl -- # file: array-next50.pl # use strict; use warnings; use Data::Dump qw/ dd /; my @vidids = 1 .. 422 ; my @counts; dd( \@vidids, \@counts ); while( ... ){ my @ids = ...; push @counts, GetCounts( \@ids ); } dd( \@vidids, \@counts ); sub GetCounts { my( $ids ) = @_; dd( $ids ); return @$ids; ## its a test :D } __END__

The ... parts are for you to fill in

The condition in the while loop is where you check to see if the array is empty or if it has any more elements left

The @ids assignment is where you remove 50 elements from @vidids, so you're not just removing the first 50, you're splicing them from the top

For the answer to the .. parts you can search the Perl documentation or just check the perlfaq or search the free perl pdf book Modern Perl or check from our Tutorials section Arrays: A Tutorial/Reference