You could also use a hash slice to associate the two arrays:
my @users = qw( alice bob charlie ); my @ids = qw( 123 456 789 ); my %id_of; @id_of{@users} = @ids; # hash slice use Data::Dumper; print Dumper(\%id_of);
Output
$VAR1 = { 'alice' => '123', 'charlie' => '789', 'bob' => '456' };
In reply to Re: Newbie Needs Help with Hash
by almut
in thread Newbie Needs Help with Hash
by jorain
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |