ccn has asked for the wisdom of the Perl Monks concerning the following question:
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
};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using "my" in hash slice
by dave_the_m (Monsignor) on Jun 18, 2004 at 09:43 UTC | |
|
Re: using "my" in hash slice
by PodMaster (Abbot) on Jun 18, 2004 at 09:28 UTC | |
by ccn (Vicar) on Jun 18, 2004 at 10:34 UTC | |
by PodMaster (Abbot) on Jun 18, 2004 at 11:07 UTC |