#!/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__