in reply to Read two files and print
How about this:
use strict; use warnings; my %required; open(IN,"<","text2.txt") or die; while(<IN>){ chomp; $required{$_}++ } close IN; open(IN,"<","text1.txt") or die; while(<IN>){ if (/\S+\s+(\S+)/ && !exists $required{$1}) { print "$1 doesnot match in text1.txt. Please help me.\n" } } close IN;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Read two files and print
by sandy1028 (Sexton) on Feb 26, 2009 at 03:42 UTC | |
by velusamy (Monk) on Feb 26, 2009 at 04:27 UTC | |
by GrandFather (Saint) on Feb 26, 2009 at 04:34 UTC |