in reply to map it back jack
my $v; my %myhash = map { $v = $_; s/_/ /g; $v, $_ } @elements; [download]
Update: As I0 points out, this also modifies @elements, which may not be what you want.
johannz's for construct is looking the most elegant to me now.
my %myhash = map { $v=$_; y/_/ /; $_,$v } @elements; [download]