[EMAIL PROTECTED] (Bart Lateur) wrote:
>Load the "removes" file into a hash (as the hash keys). Do a grep() on
>the master file for those entries that aren't in the hash.
>
>       #! perl -i.bak
>       @ARGV = 'master';
>       open REMOVE, 'remove' or die "Cannot open file: $!";
>       while(<REMOVE>) {
>           chomp;
>           $remove{$_} = 1;
>       }
>       # Ready? Go!
>       $\ = "\n";
>       while(<>) {
>           chomp;
>           print unless $remove{$_};
>       }

To simplify, avoid the chomping:

        #! perl -i.bak
        @ARGV = 'master';
        open REMOVE, 'remove' or die "Cannot open file: $!";
        while(<REMOVE>) { $remove{$_} = 1 }
        # Ready? Go!
        while(<>) { print unless $remove{$_} }


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  [EMAIL PROTECTED]                            The Math Forum

Reply via email to