in reply to Re: How can I split a hash into other N hashes
in thread How can I split a hash into other N hashes

Thanks for the array suggestion, it seems cleaner than using if and else. Thanks for your help!
  • Comment on Re^2: How can I split a hash into other N hashes

Replies are listed 'Best First'.
Re^3: How can I split a hash into other N hashes
by GotToBTru (Prior) on May 13, 2014 at 17:36 UTC

    Array version, reprise:

    my $keys = keys %{$hashref}; my @AoH; print "Original Hash Keys: $keys\n"; my $i=0; foreach my $key ( keys %{$hashref} ) { $AoH[$i++]{$key} = $hashref->{$key}; $i %= $numOfHashes; } print Dumper(@AoH);
    1 Peter 4:10