while (@array) { my ($key, @vals) = splice @array, 0, 3; $hash{$key} = [ @vals ]; }