my %acgt; @acgt{ qw[ a c g t ] } = 0 .. 3;
sub encode {
my $string = lc shift;
die "String '$string' >16 chars" if length $string > 16;
my $bits = '';
vec( $string, $_, 2 ) = $acgt{ substr $string . 'a' x 16, $_, 1 }
for 0 .. 15;
return unpack 'N', $bits;
}
####
my $lookup = '';
while( ) {
chomp;
vec( $lookup, encode( $_), 1 ) = 1;
}
####
while( ) {
chomp;
print if vec( $lookup, encode( $_ ), 1 );
}