my %hash = map { $_ => { key1 => 'longstring'.$_.'more' } } @list; $hash{$_}{key2} = alter($hash{$_}{key1}) foreach keys %hash;