while () { chomp; my @fields = split /,/; my $pc = $fields[0]; # get the first field $pc =~ s/"//g; # get rid of the quotes if (! exists $old {$pc}) { # the new pc file has a pc which did not exist # in the old pc file print "new PC found: $pc\n"; } } # and cleanup close (OLD); close (NEW);