Thank you all for your prompt response.
Few comments to your questions:
"izut: Can't figure out why you are printing in the end of the loop..."
At the end, I want to print everything that doesn't exist in hash1 or hash2 into OUTPUT1.
"QM: Also, your description is confusing, as you mention %hash3, but %hash3 never shows up in the code."
I apologize for the confusion...it's actually just hash1 and hash2 (I think I mentioned these as hash2 and hash3 elsewhere, but ignore this)
Here's an illustration of what I'm trying to achieve...I hope this helps.
DATA:
hash1:
ABC123
ABC456
hash2:
ABC456
Main File1:
ABC123
ABC456
XYZ123
XYZ456
OUTPUT1:
ABC123
ABC456
XYZ123 ###values not found in hash1 or hash2 will go to OUTPUT1
XYZ456
OUTPUT2:
ABC456
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.