#!/usr/bin/perl

# taken from: http://linuxopen.ru/2008/12/08/etcpasswd-udaljaem-neugodnykh-.html
# prints FILE lines that DOES NOT contain '(.*):' from LIST

use strict;
use warnings;

sub usage()
{
	print("Usage: $0 FILE LIST");
	exit(1);
}

usage() if (($#ARGV + 1) < 2);


my %hash;

open(FILE, $ARGV[0]) or die("$ARGV[0]: $!");
open(LIST, $ARGV[1]) or die("$ARGV[1]: $!");

while (<LIST>)
{
	chomp;
	# my $s = $_;
	$hash{$_} = "1";
}
close(LIST);

while (<FILE>)
{
	my ($sub, undef) = split(/:/);
	print $_ unless $hash{$sub};
}
close(FILE);
