http://qs1969.pair.com?node_id=491993

shiza has asked for the wisdom of the Perl Monks concerning the following question:

Say we have:
my %hash = ( key1 => 'longstring', key2 => alter('longstring'), );

Basically, I'd like to do something like:
my %hash = ( key1 => 'longstring', key2 => alter($hash{key1}), );

This is just out of curiosity. I'm well aware of other ways to accomplish the same. For instance:
my $s = 'longstring'; my %hash = ( key1 => $s, key2 => alter($s), );


UPDATE:
-----------------------------------------
I appreciate the solutions provided thus far, but in order to help everyone see what I'm trying to do, I'll add some more detail:
my %hash = map {$_ => { key1 => 'longstring'.$_.'more', key2 => alter('longstring'.$_.'more') } } @list;

The value of key1 has to be laying around somewhere?!?
------------------------------------------
Thanks in advance.