Cluster_1 Host 1 Host 2 Host 3 Host 4 Host 5 Host 6 Host 7
...and so on, acting on a set of hosts for each cluster, before moving on to the next cluster.
Here's a catch: I need to act on hosts 1-6 differently than host 7 and before host 7. I have my routines pretty much finished, however, I can't for the life of me figure out how to construct, then iterate sequentially through an appropriate data structure.
My idea, although I'm not sure exactly how to implement it, is to use a HoHoL.
my %clusters = ( cluster1_TS => ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], cluster1_SA => ['h7'], cluster2_TS => ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], cluster2_SA => ['h7'], cluster3_TS => ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], cluster3_SA => ['h7'], cluster4_TS => ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], cluster4_SA => ['h7'], cluster5_TS => ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], cluster5_SA => ['h7'], );
Not sure if the above even makes sense, but I'll continue.
My questions:
1. Does the above make sense, or is there another (better way) to accomplish what I need to accomplish?
2. What I need to accomplish, is to take action in EXACTLY the order portrayed in the data structure above. How can I create a looping statement for the above?
3. Assuming that the above data structure is doable, how would one populate it?
I know that this is a very (well, for me) complicated question, but any assistance would be appreciated, as my new employer needs to get this tool to QA tomorrow!
In reply to Data Structure Design by Tuna
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |