my %hash = map {$_ => { sub { key1 => $_[0], key2 => alter($_[0]) }->('longstring'.$_.'more') } } @list;