#!/usr/bin/perl use strict; use warnings; use diagnostics; use FAlite; die "usage: $0 \n" unless @ARGV == 2; my %list; open(LIST, $ARGV[1]) or die; while () { next if /^#/; my ($header, $score) = split; $list{ $header } = $score; } close LIST; open(FASTA, $ARGV[0]) or die; my $fasta = new FAlite(\*FASTA); while (my $entry = $fasta->nextEntry) { if( exists $list{ $entry->def } ) { print $entry->def; print $entry->seq; } } close FASTA; __END__