in reply to Re: use array for hash-keys without loop
in thread use array for hash-keys without loop

$ perl -le' use Data::Dumper; my @a = "A" .. "D"; my %hash; $hash{@a} = (0) x @a; print Dumper \%hash; ' $VAR1 = { '4' => '0000' };

Oops!

Replies are listed 'Best First'.
Re^3: use array for hash-keys without loop
by almut (Canon) on Mar 11, 2010 at 13:06 UTC
    $hash{@a} = (0) x @a;

    Using @hash{@a} (as cdarke did) instead of $hash{@a} avoids the issue...

      He must have changed it after I posted because I copied and pasted that from his post.