There's more than one way to do things | |
PerlMonks |
Re^5: Filtering Output from two filesby AnomalousMonk (Archbishop) |
on Feb 04, 2018 at 16:18 UTC ( [id://1208431]=note: print w/replies, xml ) | Need Help?? |
If your File1 has 700,000 lines, rest assured that a hash can easily accommodate this number of lines or even many more — if the lines are sufficiently short, i.e., not thousands of characters! One pitfall to avoid: When you read each line from your File1, it will have some kind of line-end delimiter, typically a newline. This will have to be removed (see chomp) before adding it to the lookup hash because a COA213345 field split from the beginning of a line in File2 will have no such delimiter. (Looking up a key in a hash (see exists) is essentially an eq string exact equality operation.) Perhaps take a look at some of the articles in the Input and Output section of the Monastery's Tutorials. Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|