in reply to Comparing files
Results:#!/usr/bin/perl use strict; my ($source_filename,$exclusion_filename) = @ARGV; # read each line of exclusion file and store as a hash-key (for quicke +r look-up) open EXCLUSION, "$exclusion_filename" or die "Could not open file of e +xcluded lines: $!\n"; my %exclude = map { ($_ => 1) } <EXCLUSION>; close EXCLUSION; open SOURCE, "$source_filename" or die "Could not open source file: $! +\n"; while (<SOURCE>) { print unless $exclude{$_}; } close SOURCE;
[me@host scratch]$ cat > a asdf asdf fdsa asd ddd d [me@host scratch]$ cat > b ddd as [me@host scratch]$ perl tmp.pl a b asdf asdf fdsa asd d [me@host scratch]$
|
|---|