my @vals = qw( f h j ); my $i = 0; $hash{$_} = $vals[$i++] foreach qw( e g i );