In order to make your program as general as possible, it's a good idea to use an array of arrays. This makes it possible to modify your program with minimal headaches. You can use the modulus operator to determine the array into which each image goes:
my @images = qw( 1 .. 100 );
my @array_of_arrays;
my $number_of_arrays = 2;
my $count = 0;
foreach my $image (@images) {
my $index = $count % $number_of_arrays;
push @{ $array_of_arrays[ $index ] }, $image;
$x++;
}
Hope that this helps. Also, as a general hint be sure to
use strict. :D