in reply to Re^3: comparing lists
in thread comparing lists

Thanks a lot! That cleared up many things. I had to make one other slight modification...in the while loop, I cannot use LAST, rather I want to use NEXT at the end also because I want to continue to check until the end of the file rather than break the loop as soon as the last requirement is met.

while ($line = <ORIGACCTLIST>){ chomp $line; ($filename, $state, $amt, $ttl, $account, $name, $invnum) = split /\t/ +, $line; $name =~ s/\s+$//g; next if exists $exclusionlist{$account}; print $output "$filename\t$state\t$amt\t$ttl\t$account\t$name\t$invnum +\n"; if (exists $ncacctlist{$account}) { print $ncoutput "$filename\n"; next; } if (exists $ccacctlist{$account}) { print $ccoutput "$filename\n"; next; } if (exists $ccnamelist{$name}) { print $ccoutput "$filename\n"; next; } print $ncoutput "$filename\n"; next; }