in reply to comparing two lists

i love map. this is a great example of why. actually, you're using grep, which is very similar to map. but it's all in how you use it.

you may get some milage out of this code. i grabbed it from the snippets section some time ago.

# Determining whether an item is in a list my @items = ('bbb', 'ddd'); my @list = ('aaa', 'bbb', 'ccc', 'ddd', 'eee'); foreach $item (@items) { if ({ map { $_ => 1 } @list }->{$item}) { print "Yes!\n"; } else { print "No!\n"; } }
it's recycled from somewhere in the snippets section. also, you might want to look at:
diff of two hashes and a few others. try a search on 'diff hash' for more clues.

~Particle