Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use Data::Dumper;
- %hostgroups = (
- 'net47.dmz' => ['aidos','apache1'],
- 'net200.dmz' => ['aletheia','antispam1'],
- );
- # 'all' => ['agrios','aidos','aletheia','antispam1','apache1'],
- #%newhostgroups = (
- #'all' => [\@net47dmz, \@net200dmz]
- #);
- #@{$hostgroups{'all'}} = [ $hostgroups{'net47.dmz'}, $hostgroups{'net200.dmz'} ];
- @{$hostgroups{'all'}} = [ \@{$hostgroups{'net47.dmz'}}, \@{$hostgroups{'net200.dmz'}} ];
- foreach $key (keys %hostgroups) {
- print "$key --> $hostgroups{$key}\n";
- }
- print "\n-------------------------\n";
- foreach $key (keys %hostgroups) {
- print "$key --> ";
- print $_." " foreach @{$hostgroups{$key}};
- print "\n";
- }
- #print Dumper(\%hostgroups);
Add Comment
Please, Sign In to add comment