my %hash; for $var (@array) { while () { chomp; $hash{$_} = $var; } }