
English Guy
New User
Sep 2, 2002, 9:16 AM
Views: 1150
|
|
Match or No Match, that is the question!!
|
|
|
Hi, I have a simple script, which reads an email file, then greps another file which has the email address & real name of the users, then prints the email address & name if it finds a match, or prints No Match for $line if no match found. I cannot get it to wortk though!! My code is as follows - open(FILE, "$path/$file"); foreach $line(<FILE>) { open(GREP, "cat $path | grep $line|"); while(<GREP>) { if (/(\S+)\s?[-]\s?(\S+\s+\S+)/) { print "$1 - $2"; } #jsmith@dot.com - John Smith else { print "No Match for $line"; } } } close(GREP); close(FILE); Any Help appreciated!!!!
(This post was edited by English Guy on Sep 2, 2002, 9:16 AM)
|