in reply to my array is almost a hash, but keys are not unique.

#!/usr/bin/perl -- use strict; use warnings; my $in = [ one => 1, two => 2, two => '2.003' ]; my $ou = {}; for( my $ix = 0; $ix < $#$in; $ix += 2){ push @{ $ou->{ $in->[$ix] } }, $in->[$ix+1]; } use Data::Dumper; print Data::Dumper->new([ $in, $ou ] )->Indent(1)->Dump; __END__ $VAR1 = [ 'one', 1, 'two', 2, 'two', '2.003' ]; $VAR2 = { 'one' => [ 1 ], 'two' => [ 2, '2.003' ] };