use strict; use warnings; use Data::Dump::Streamer; my @in = (one => 1, two => 2, two => '2.003'); my %hash; while (@in > 1) { my ($key, $value) = splice @in, 0, 2; push @{$hash{$key}}, $value; } Dump \%hash; #### $HASH1 = { one => [ 1 ], two => [ 2, 2.003 ] };