cadphile has asked for the wisdom of the Perl Monks concerning the following question:
So, this is a curious construct, which I'd be interested in hearing some deep esoteric explanation for (basically, explain the assignment of the hash: @b{@f}=(); ). How does the hash get assigned by using the list symbol on it?
$> perl -M'Data::Dumper' -le '@f=("f1","f2","f3"); my %b; @b{@f}=();pr +int Dumper(\@f); print Dumper(\%b)' $VAR1 = [ 'f1', 'f2', 'f3' ]; $VAR1 = { 'f1' => undef, 'f3' => undef, 'f2' => undef };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Hash Curious
by choroba (Cardinal) on Oct 15, 2021 at 23:34 UTC | |
Re: Hash Curious
by LanX (Saint) on Oct 16, 2021 at 00:09 UTC | |
by eyepopslikeamosquito (Archbishop) on Oct 16, 2021 at 04:36 UTC | |
by LanX (Saint) on Oct 16, 2021 at 09:09 UTC | |
by LanX (Saint) on Oct 16, 2021 at 10:33 UTC | |
by gfldex (Initiate) on Oct 18, 2021 at 19:46 UTC |
Back to
Seekers of Perl Wisdom