in reply to map it back jack

I can do it in just one line, but I prefer using just a reverse for statement:

my %myHash; ($myHash{$_} = $_) =~ s/_/ /g for (@elements);

Replies are listed 'Best First'.
Re: Re: map it back jack
by ichimunki (Priest) on Dec 16, 2000 at 04:11 UTC
    Of the solutions, I like this one the best. I would avoid the map function unless you are certain there is nothing in %myHash that you want to keep. None of the map solutions shown preserve any original elements the hash might contain-- except maybe the one with the void context problem. :)