I work with the Perl API of the Infoblox application (doc: https://ipam.illinois.edu/api/doc/ )
I have the following code:
... my $specificRecord = $recordResults[0]; say $specificRecord->name(); foreach ($specificRecord->ipv4addrs()) { say $_; }
$ specificRecord contains the entry object Infoblox :: DNS :: Host.
My problem arises when I repeat ipv4addrs (). According to the perl documentation and debugger, ipv4addrs () returns an ARRAY containing IP addresses or DHCP :: FixedAddr objects.
In my case, if I debug my program and "x" $ specificRecord-> ipv4addrs () as well as $ _, I get the same result:
DB<1> b 70 DB<2> c Results: 1 aaaa9999test.justice main::(testScript2.pl:70): foreach ($specificRecord->ipv4addrs()) main::(testScript2.pl:71): { DB<2> x $specificRecord->ipv4addrs(); 0 ARRAY(0x64e9e3c) 0 '8.8.8.8' 1 '8.8.4.4' DB<3> n main::(testScript2.pl:72): say $_; DB<3> x $_; 0 ARRAY(0x64e9e3c) 0 '8.8.8.8' 1 '8.8.4.4'
Here is the corresponding "x" part of the Infoblox :: DNS :: Host object:
DB<2> x $specificRecord; 0 Infoblox::DNS::Host=HASH(0x8b3eacc) '__object_id__' => 'dns.host$._default.justice.aaaa9999test' 'aliases' => ARRAY(0x8b3e9fc) empty array 'configure_for_dns' => 'true' 'disable' => 'false' 'ipv4addrs' => ARRAY(0x64e9e3c) 0 '8.8.8.8' 1 '8.8.4.4' 'ipv6addrs' => ARRAY(0x8aa1bac) empty array 'name' => 'aaaa9999test.justice' ...
I cannot say what I am doing wrong, and why foreach does not work with the variable $ _. I tried to assign ipv4addrs () to an array, and then reinstall it, but to no avail.
source share