develooper Front page | perl.perl5.porters | Postings from July 2018

hash slice assignment

Thread Next
H.Merijn Brand
July 27, 2018 09:51
hash slice assignment
Message ID:
This is perl 5, version 24, subversion 1 (v5.24.1) built for x86_64-linux-thread-multi-ld

$ perl -wE'my%h=(foo=>{});$h{foo}{qw(a b)}=(1,2)'

$ perl -wE'my%h=(foo=>{});$h{$_}{qw(a b)}=(1,2)for"foo"'

$ perl -wE'my%h=(foo=>{});$h{$_}{qw(a b)}=($_,2)for"foo"'
Useless use of a variable in void context at -e line 1.

Can somebody explain why?

H.Merijn Brand   Perl Monger
using perl5.00307 .. 5.27   porting perl5 on HP-UX, AIX, and openSUSE

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About