On Tue Jul 04 23:20:59 2006, guest wrote:
Show quoted text> The documentation says that assigning multiple values at a time should
> work, i.e. :
>
> $hash{'more'} = ('fee','fie', 'foe', 'fum');
>
> Unfortunately this only assigns the last element to the list:
>
> x \%hash
> 0 HASH(0x359970)
> 'more' => ARRAY(0x3599f4)
> 0 'fum'
You are correct; at the moment I don't see a (non-filter) way to emulate list assignment. I
would suggest a 'foreach' instead:
foreach my $item (qw(fee fie foe fum)) { $hash{more} = $item }
Not as nice, but it's the best alternative that I can come up with that doesn't involve nasty
stuff. I will fix the docs in the next release.