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;
In reply to Re: Read two files and print
by hbm
in thread Read two files and print
by sandy1028
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |