in reply to Split a large array into 10 smaller arrays

The following script lacks error-checking, but should give an idea of how to proceed:

#! perl use strict; use warnings; use Data::Dump; my @accts_split; my @accts = (23 .. 257); my $start = 0; my $length = @accts / 10; for my $i (0 .. 9) { my $end = ($i == 9) ? $#accts : $start + $length - 1; @{$accts_split[$i]} = @accts[$start .. $end]; $start += $length; } dd @accts_split;

Output:

19:42 >perl 571_SoPW.pl ( [23 .. 45], [46 .. 69], [70 .. 92], [93 .. 116], [117 .. 139], [140 .. 163], [164 .. 186], [187 .. 210], [211 .. 233], [234 .. 257], ) 19:44 >

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,