Just be careful to avoid this sort of situation:
my @keyset = qw/this repeat that repeat/ my @valset = qw/jerry george elaine kramer/; my %hash; @hash{@keyset} = @valset; print "$_: $hash{$_}\n" foreach keys %hash; __OUTPUT__ that: elaine this: jerry repeat: kramer
For nonunique keys, only the last item assigned to a given nonunique key will be preserved. Poor 'george' was discarded.
Dave
In reply to Re: Two arrays. One hash.
by davido
in thread Two arrays. One hash.
by matt me
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |