deibyz has asked for the wisdom of the Perl Monks concerning the following question:
I have a problem with a data integrity check on a potentially huge data structure.
Let me try to explain,
I have an AoH like that:
%AoH =( { Identifier1 => Anumber, IdNumber1 => 1100001, Identifier2 => Bnumber, IdNumber2 => 1000000, Identifier3 => Cnumber, IdNumber3 => 2222222 } [... More ...] );
Each element can have 1, 2 or 3 different identifiers, out of about a total of 10 (Jnumber).
I have to make a consistency check to see if every distinct identifier set (that can be incomplete) is coherent with the rest.
For example, this is wrong: (Abrev. sintax)
Anumber = 1, BNumber = 2, Cnumber = 3 Anumber = 1, BNumber = 4, Cnumber = 3 #Bnumber is different
This is wrong too:
Anumber = 1, BNumber = 2, Cnumber = 3 Cnumber = 3, DNumber = 4, Enumber = 5 Enumber = 5, Anumber = 2, <undef> # harder to found # Anumber changes
I've tried some approachs, different hashes for each identifier type referencing the rest of the data, but all of them end being a huge unreadable code, taking a lot of memory and resources (I can have more than 100k elements in this array, and keeps growing)
Is there any "easy" way to do it that I'm missing?
Thanks in advance,
deibyz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Complex data structure check
by stvn (Monsignor) on Aug 13, 2004 at 18:04 UTC | |
|
Re: Complex data structure check
by waswas-fng (Curate) on Aug 13, 2004 at 18:49 UTC | |
|
Re: Complex data structure check
by graff (Chancellor) on Aug 14, 2004 at 03:17 UTC |