> my %hash = map +($_=>undef), @list;
For varying definitions of "useful". This needs 2 letters more than the usual notation
my %hash = map {$_=>undef} @list; °
°) see choroba's reply why the parser will have trouble interpreting this.
FWIW: I'd use a hash-slice @hash{@list} = () anyway
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
In reply to Re^8: Passing argument by reference (for a scalar)(Unary Plus)
by LanX
in thread Passing argument by reference (for a scalar)
by jmClifford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |