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

hash slice assignment

Thread Next
From:
H.Merijn Brand
Date:
July 27, 2018 09:51
Subject:
hash slice assignment
Message ID:
20180727115000.7f7bbf64@pc09.procura.nl
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  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.27   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About