Hi guys,
I am creating a hash to store my servers. Here is my hash example:
push(@ { $array{examplesite}{'App-servers'}{'Application Server'}{'External IP'} },'test');
push(@ { $array{examplesite}{'App-servers'}{'Application Server'}{'External IP'} },'test1');
push(@ { $array{examplesite}{'App-servers'}{'Database server'}{'External IP'} },'test1');
I am able to get external ip printed by doing this:
for $item ( @ { $array{examplesite}{'App-servers'}{'Application Server'}{'External IP'} }){
print $item;
}
But I have to specify 'Application Server' within my for query, I would like to print everything after {'App-servers'} so I can see database servers as well as app-servers. Any suggestions how I can do that ?
I am creating a hash to store my servers. Here is my hash example:
push(@ { $array{examplesite}{'App-servers'}{'Application Server'}{'External IP'} },'test');
push(@ { $array{examplesite}{'App-servers'}{'Application Server'}{'External IP'} },'test1');
push(@ { $array{examplesite}{'App-servers'}{'Database server'}{'External IP'} },'test1');
I am able to get external ip printed by doing this:
for $item ( @ { $array{examplesite}{'App-servers'}{'Application Server'}{'External IP'} }){
print $item;
}
But I have to specify 'Application Server' within my for query, I would like to print everything after {'App-servers'} so I can see database servers as well as app-servers. Any suggestions how I can do that ?