in reply to Hash assignments using map
In addition to what others have said, you could do:
which you would then test with exists $keepers{$x}. Althought I'm curious why you need the %keepers hash if you have the @to_keep array.my @to_keep = (...); my %keepers; @keepers{@to_keep} = ();
In Section
Seekers of Perl Wisdom