Search
 
SCRIPT & CODE EXAMPLE
 

PERL

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;
            }
        }
    }
Comment

PREVIOUS NEXT
Code Example
Perl :: Move files to new directory 
Perl :: perl mechanize check mirror response for errors 
Perl :: perl http request 
Perl :: Perl (perl 2018.12) sample 
Pascal :: pascal press any key to continue 
Pascal :: pascal error handling 
Pascal :: for loop pascal 
Pascal :: pascal cheat sheet for programmers 
Powershell :: How to display firewall rule ports with powershell 
Gdscript :: godot check if object is in group 
Gdscript :: GDScript typed variables 
Abap :: abap concatenate 
Cobol :: gatsby with yarn 
Assembly :: javafx fxml loader example 
Assembly :: ARM assembly divide by 2 
Assembly :: dokuwiki redirect 
Javascript :: jquery vslidation remove spaces from input 
Javascript :: map range of numbers to another range 
Javascript :: jest cache clear 
Javascript :: javascript replace spaces with dashes 
Javascript :: import redux thunk 
Javascript :: jquery refresh page 
Javascript :: delete session javascript 
Javascript :: get week day name in javascript 
Javascript :: how to remove checked attribute of checkbox in jquery 
Javascript :: loop array backwards javascript 
Javascript :: generate random whole numbers within a range javascript 
Javascript :: jquery remove and add class 
Javascript :: how to use another port in angular 
Javascript :: How to get current URL with Javascript or React 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =