in reply to compare lists and delete unwanted from file
You can use Tie::File for the deletion of the unwanted records.
use Tie::File; ... tie my @ptt_records, q{Tie::File}, $ptt_file or die $!; foreach my $k1 (keys %empty_geneids){ @ptt_records = grep { ! /$k1/ } @ptt_records; } untie @ptt_records;
Note that you don't need an intermediate file ($ptt_file2) with this technique.
Also, Tie::File uses a very small memory footprint which may be a bonus given you're working with biological data.
-- Ken
|
|---|