$ perl -e 'open F,$ARGV[0] or die;shift;my %set = map {$_ => 1 } <>; for () {print if $set{$_}};' A B lime