in reply to Creating lists using a hash with the same key/values

Idiomatically you would do this:

my @list = qw( foo bar baz ); my %hash; $hash{$_}++ for @list; # now do a lookup if ( $hash{$look_this_up} ) { # blah } use Data::Dumper; print Dumper \%hash __DATA__ $VAR1 = { 'foo' => '1', 'baz' => '1', 'bar' => '1' };

This populates the hash with identical values (ie 1). It means that $hash{$value} will be true if $value is in the hash or false if it is not. We are really only interested in the keys for the fast lookup but having a true value lets us avoid having to use exists

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print