%h = (key1 => 'content1', key2 => 'content2'); $h{FLIPPED} = { map {$h{$_}, $_ } (keys %h) }; print "$h{key1} : $h{FLIPPED}{content1}\n";