It works fine with:my %a; @a{ my @b } = ();
perl -wle 'use Data::Dumper; my %a; @a{my @b=()} = (); print Dumper(\% +a)'
Output:
$VAR1 = {};
But it's NOT work with
perl, v5.8.4 built for i686-linux-thread-multi
Output:
Use of uninitialized value in hash slice at -e line 1.
$VAR1 = {
'' => undef
};
In reply to using "my" in hash slice by ccn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |