in reply to Comparing files

OK, I can't read your code easily, and I don't really feel like trying. If what you want is "all lines found in file1 which are not in file2" then here you go:
#!/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;
Results:
[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]$

------------
:Wq
Not an editor command: Wq