Subject: | Bug in interfaces example |
The example for interfaces is incorrect.
my $interfaces = $hostip->interfaces;
foreach my $interface ( @{$interfaces} ) {
my $ip = $interfaces->{$interface};
print "$interface => $ip"\n";
}
1. There is an extra double quote between $ip and \n.
2. $interfaces is not an array reference.
The following does work but feel free to change it however you like.
my $interfaces = $hostip->interfaces;
foreach my $interface ( keys %{$interfaces} ) {
my $ip = $interfaces->{$interface};
print "$interface => $ip\n";
}