#!/usr/bin/perl my @a, %hash; my $file = shift; open(list, "< $file") or die; chomp( @a= ); close(list); @hash{@a}=@a; $/ = ""; # Example data # # $ cat hash # PP22x43@.5 # $ cat data # \n # Random lines # PORNUM: PP22x43@.5 # Random lines # \n # Random lines # PORNUM: PC12x120/25 while (<>) { ## manual test # print if !m/PORNUM: PP22x43@.5/ms; print unless exists $hash{ } } exit(0);