in reply to Re^7: Passing argument by reference (for a scalar)
in thread Passing argument by reference (for a scalar)
> 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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Passing argument by reference (for a scalar)(Unary Plus)
by choroba (Cardinal) on Sep 11, 2024 at 11:35 UTC | |
by LanX (Saint) on Sep 11, 2024 at 15:13 UTC | |
|
Re^9: Passing argument by reference (for a scalar)(Unary Plus)
by etj (Priest) on Sep 11, 2024 at 14:38 UTC | |
by LanX (Saint) on Sep 11, 2024 at 15:00 UTC |