perlreftut says "Whatever you want to do with a reference, Use Rule 1 tells you how to do it. You just write the Perl code that you would have written for doing the same thing to a regular array or hash, and then replace the array or hash name with {$reference} ."
My traditional hash gets the values assigned to keys with this:
So I thought some form of this would work but I can't get it right.my @values = ("value1", "value2", "value3"); @employees{qw(key1 key2 key3)} = @values;
I've tried many more combinations, including moving the brackets all over the place. Is this even close? I need a bigger hint I guess.@{$hashref->{qw/key1 key2 key3/}} = @values; %{$hashref}->{qw/key1 key2 key3/} = @values;
In reply to Re: Assigning values to undef hash reference keys two or more at a time
by gctaylor1
in thread Assigning values to undef hash reference keys two or more at a time
by gctaylor1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |