in reply to Need code for comparing

Seems pretty straight forward. What have you tried so far? Hopefully, here is something to help you.
#!/usr/bin/perl use strict; my $file_1 = <<HEREDOC; daw2n 189445 eastparkway ca daw1n 189445 eastparkway ca dawn 189445 eastparkway ca HEREDOC open( my $file, '<', \$file_1 ) or die "Cannot open $file_1"; my @first_records = <$file>; close( $file ); while (my $line = <DATA>) { for my $i (@first_records) { print "Record in file 1 found in file 2: $i" if ( $line eq "$i" ); } } __DATA__ kathy 329390 westbrook wa kat1hy 329390 westbrook wa dawn 189445 eastparkway ca kat2hy 329390 westbrook wa