![]() |
|
Don't ask to ask, just ask | |
PerlMonks |
Re: comparing two sets of databy ColonelPanic (Friar) |
on Nov 28, 2012 at 09:20 UTC ( [id://1005987]=note: print w/replies, xml ) | Need Help?? |
It appears that the "key" is the entire line of file1. If so, then this is a pretty easy task. Here is an example:
Regex Notes: \b matches a word boundary. This is because you presumably wouldn't want "John Smith" to match "John Smithfield". \Q...\E is the quote literal modifier. If your key contains characters with a special meaning in regexes (such as the dot in "Mr. Smith") you want to match only the literal characters. Yes, you do end up needing a nested loop...that is intrinsic to the nature of your task. When's the last time you used duct tape on a duct? --Larry Wall
In Section
Seekers of Perl Wisdom
|
|