#!/usr/bin/perl use strict ; use warnings ; my $file1 = shift; my $file2 = shift; open(IN,$file1) || die "Cannot open file $file1 $!\n"; my $content ; { local $/ ; $content = } close IN ; open(IN,$file2) || die "Cannot open file $file2 $!\n"; my @list = ; close IN ; my @new = grep($content !~ /$_->[0]\n/, map( [split(/,/, $_)], @list )) ; foreach( @new ) { print $_->[0] . " " .$_->[1] ; }