open STUB, "stub.c" or die "Cannot open stub.c : $!\n"; while () { chomp; # $_ is now a line from stub.c, # and we have to decide whether to print it or not. # If it's a key in %hash1 we don't want to print it; # otherwise, we do: print "$_\n" if not exists $hash1{$_}; }