Horje
perl split array into smaller arrays Code Example
[Solved] - perl split array into smaller arrays Code Example
Try following codes
perl split array into smaller arrays
    my @array = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
    my $numberofarrays = 10;
    my @splitArray;
    
    while (@array) {
        foreach    (0..$numberofarrays-1){
            if (@array) {
                push @{$splitArray[$_]}, shift @arrays;
            }
        }
    }
Date: 2022-05-21 05:02:10
Category: perl
More for You