- or download this
my @arr = qw ( apples oranges bananas pears berries apricots );
my @arr_of_columns = split_list( \@arr, 2 );
- or download this
['apples', 'bananas','berries', 'prunes']
['oranges','pears', 'apricots']
- or download this
my $arr_of_arr = split_list( [ 1 .. 7 ], 3, undef ); - or download this
[1,4,7]
[2,5,undef]
[3,6,undef]
- or download this
sub split_list {
use integer;
my ( $list_ref, $qty, $pad ) = @_;
...
return @return if wantarray;
return \@return;
}