in reply to Array to Hash
Use a hash slice:
If you don't care about the keys having values, but just want them to exist, you can just do:my @array = qw/foo bar baz quux/; my %hash; @hash{@array} = (1) x @array;
But now you need to test for existence in the hash by using exists:@hash{@array} = ();
print "foo is there" if exists $hash{foo};
In Section
Seekers of Perl Wisdom