Tuna has asked for the wisdom of the Perl Monks concerning the following question:
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid - plan for the future) Re: Data Structure Design
by Ovid (Cardinal) on Aug 17, 2001 at 05:03 UTC | |
|
Re: Data Structure Design
by kjherron (Pilgrim) on Aug 17, 2001 at 08:11 UTC | |
|
Re: Data Structure Design
by jepri (Parson) on Aug 17, 2001 at 04:54 UTC | |
|
Re: Data Structure Design
by Tuna (Friar) on Aug 17, 2001 at 05:24 UTC | |
by tachyon (Chancellor) on Aug 17, 2001 at 08:44 UTC | |
|
Re: Data Structure Design
by MZSanford (Curate) on Aug 17, 2001 at 13:04 UTC | |
|
Re: Data Structure Design
by jwest (Friar) on Aug 17, 2001 at 17:50 UTC | |
|
Here's what I did:
by Tuna (Friar) on Aug 18, 2001 at 22:38 UTC | |
|
Re: Data Structure Design
by Nitsuj (Hermit) on Aug 18, 2001 at 20:48 UTC |