in reply to Re: Array to hash refs
in thread Array to hash refs

my @array = qw /a b c/; my %hash = map {$_ => 1} @array; return \%hash;

can that be done with a map and a hashref rather than having to return a hashref? ripped off from tadman in Re: an easier way with grep, map, and/or sort?.

Replies are listed 'Best First'.
Re: Array to hash refs
by Abigail-II (Bishop) on Aug 13, 2002 at 16:28 UTC
    return {map {$_ => 1} qw /a b c/}
    Or did I understand your questing wrong?