Thanks for your answers!
I had a vague sense that something was blocking either the level-1 assignments or level-3 assignments. Data::Dumper certainly cleared that up (I had never used this before, and this will become a favorite.)
What I'm trying to do is use a hash to do a hash to merge two sets:
Set 1: I have a text file establishing the universe of accepted values:
abc 123
abc 456
abc 789
xyz 456
Hash:
123->abc
456->abc
456->xyz
789->abc
Set 2: A set of values pointing to the hash. There may be multiple recs pointing to a hash rec (that's OK, as I just need to know of the existence of one). There maybe hash records that no one uses.
xxx ==> 456->abc
xxx ==> 789->abc
yyy ==> 456->abc
yyy ==> 456->abc (a dup)
zzz ==> 123->abc
Resulting hash
123->abc->zzz
456->abc->xxx
456->abc->yyy
456->xyz
789->abc->xxx
I could just hash the second set, but I won't get the non-use ones like 456->xyz.
I've tried building the first hash and using arrays for the latter hash, but it runs rather slowly from all the repeated scans.
Suggestions appreciated.
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.