note
InfiniteSilence
<p>Code rewrite</p>
<code>
use warnings;
use strict;
use Data::Dumper;
my @a = (1..1284);
my $chunkedRef = chunky(@a);
sub chunky {
#for chunks (chunks = 100 blocks of passed -in array)
my %master;
for(0..int @_/100)
{
# create an array for each 100 elements and add it to the hash
push @{$master{$_+1 . ' key'}},@a[$_*100..$_*100+100];
}
return \%master;
}
print Dumper %$chunkedRef;
1;
</code>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-45622">
<P><I>Celebrate Intellectual Diversity</I>
</div></div>
1089291
1089291