#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %hash = ( a => 1, b => 2, c => 3, d => 4, ); my $keycount = (keys %hash); # hash has 4 keys (and 8 elements) # array index: 0 1 2 3 4 5 6 7 # hash value: a, 1, b, 2, c, 3, d, 4 my %hash1 = splice [ %hash ], 0, $keycount; my %hash2 = splice [ %hash ], $keycount, $keycount; print Dumper \%hash1, \%hash2; exit;