and this works
No, this not works:
my $data = {key => "THIS: "}; my $val = "HI THIS WORKS"; $data{key} .= $val; print "$data{key}"; __END__ HI THIS WORKS
Why? cuz $data (SCALAR, may hold an anonymous hash) and %data (HASH) are different variables.
Read the perldata manual page. Seriously:
Read perldata.
update:
Reading perldata is not a waste of time. It saves you a lot of puzzling and doubts for time to come. Not reading it in turn wastes your and our time.
In reply to Re: adding value to hash
by shmem
in thread adding value to hash
by bigup401
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |