vedas has asked for the wisdom of the Perl Monks concerning the following question:
I'm still learning perl. It trying to pull IPs from a infoblox system using their API. According to their API Documentation the "get" method:
"Return an array in list context containing all matching objects. For failures and objects not found, it returns an empty array in list context and undefined in scalar context. When an operation fails, the error code and error message are reported in the status_code() and status_detail() attributes."
So, I'm expecting to get an array of objects (IPs) back after call the get method, however this is not what I am getting. Below is the relevant code and output
CODE : : : my @retrieved_objs = $session->get( object => "Infoblox::DNS::Record::A", name => "nsx10cs.cnti.com" ); print "retrieved_objs[0]: " . $retrieved_objs[0] . "\n"; print "retrieved_objs[1]: " . $retrieved_objs[1] . "\n"; : : :
OUTPUT Infoblox::DNS::Record::A=HASH(0x55d0d1517aa0) retrieved_objs[0]: Infoblox::DNS::Record::A=HASH(0x55d0d1517aa0) retrieved_objs[1]:
It appears to be giving the memory reference to hash, I was expecting ip objects. Any one have any thoughts on where I'm going wrong?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: print a hash reference
by haukex (Archbishop) on Jan 10, 2019 at 19:46 UTC | |
|
Re: print a hash reference
by trippledubs (Deacon) on Jan 10, 2019 at 19:22 UTC | |
by vedas (Novice) on Jan 10, 2019 at 22:43 UTC |