in reply to compare records in two csv files

Hi,
make the resultfile inot a lookup hash, then go through the metrics file and check if the key exists:
#!/usr/bin/perl use strict; use warnings; my $metricsfile = $ARGV[0]; my $resultfile = $ARGV[1]; print "MetricsFilename:$metricsfile\n"; print "ResultsFilename:$resultfile\n\n"; my %results; ### Opening the result file to read #### open( IN, "<$resultfile" ) or die "Can't open $resultfile: $!"; while ( <IN> ) { chomp; # remove newline $result{$_}++; # put line into hash as key } close IN; ### Opening the metrics file to read #### open( IN, "<$metricsfile" ) or die "Can't open $metricsfile: $!"; while ( <IN> ) { chomp; # remove newline if ($result{$_}) { print "$_ is in $resultfile\n"; } else { print "$_ is NOT in $resultfile\n"; } } close IN;

Regards,
svenXY