amg has asked for the wisdom of the Perl Monks concerning the following question:
%host_groups = get_host_groups(); foreach my $group (keys %host_groups) { print "$group = $group\t"; foreach (@{$host_groups{$group}}) { print "$host = $_\n"; } } sub get_host_groups() { .... while ($line = <FILE>) { .... $group_name = $hgn[2]; .... $hash{$group_name}= [@hosts]; .... .... } return (%hash); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is it right method to use Hash
by GrandFather (Saint) on Jun 10, 2011 at 10:43 UTC | |
by amg (Initiate) on Jun 13, 2011 at 04:03 UTC | |
|
Re: Is it right method to use Hash
by bart (Canon) on Jun 10, 2011 at 11:19 UTC |