Hi all, in answering a question today I cam upon something that puzzled me. First:
$ perl -Mstrict -wle"my %hash; @hash{'array'} = 'foo';" Scalar value @hash{'array'} better written as $hash{'array'} at -e lin +e 1. $
... which is what I expected. But then:
$ perl -Mstrict -wle"my %hash; my @array; @hash{@array} = 'foo';" $
Why doesn't Perl have a warning for the latter case?
In reply to Using a hash with the @ sigil by 1nickt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |