#!/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
In reply to Re: Need code for comparing
by bichonfrise74
in thread Need code for comparing
by idy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |