my @usual = qw ( data email stuff ); #--- fixed length my $i = 0; my %hash; my @input = ( #--- rather have no function { username => 'fred1', myfunc ( 12, 56, 78 ) }, #--- no use if have to reset $i { username => 'fnerk', map { $usual[ $i++ ] => $_ } (33, 44, 55) }, #--- hmm { username => 'aargh', map { @hash{@usual} = @$_; %hash } [ 33, 44, 55 ] }, #--- longwinded { username => 'fnerk', map { $tmp = shift @usual; push @usual,$tmp; $tmp, $_ } (33, 44, 55) }, #--- heinous { username => 'aargh', map { @_{ @usual } = @$_; %_ } [ 33, 44, 55 ] }, ); sub myfunc { my %flib; @flib{ @usual } = @_; return %flib; } for ( @input ) { my %local = %$_; for (sort keys %local ) { print "key : $_ : val : $local{$_} : "; } print "\n"; }