Apologies if this seem like a simple question, I'm working on learning the more advanced topics in perl.
I'm having trouble pulling information out of data an array reference. I'm trying to print data that returned from the aliases method. Would anyone be able to tell me what I'm doing wrong?
#:Code #!/usr/bin/perl # use strict ; #use lib "/var/www/html/monkey/cgi-bin"; use lib "/var/www/html/production/cgi-bin"; # load the WebUI common libraries use Infoblox::WebUI ; use Data::Dumper; my $session = Infoblox::Session->new( master => $address, username => $user, password => $passwd, timeout => $timeout_num, connection_timeout => $conn_timeout ); print "Check:".Infoblox::status_code() . ":" . Infoblox::status_detail +()."\n"; unless ($session) { die("Construct session failed: ", Infoblox::status_code() . ":" . Infoblox::status_de +tail()); } #Get DHCP Host Address object through the session my @retrieved_objs = $session->get( object => "Infoblox::DNS::Host", name => "testone.cnti.com", ); #my @tmp_array = @$_->aliases() for (@retrieved_objs); #print "aliases: " . @tmp_array; print "aliases: " .$_->aliases(),"\n" for (@retrieved_objs); print "dns_name: " . $_->dns_name(),"\n" for (@retrieved_objs); print "ipv4addrs: " . $_->ipv4addrs(),"\n" for (@retrieved_objs); print "comment: " . $_->comment(),"\n" for (@retrieved_objs); print "name: " . $_->name(),"\n" for (@retrieved_objs);: : : :OUTPUT [user1@host perl]$ ./infoblox_test4.pl Check:0:Operation succeeded aliases: ARRAY(0x55f6da24f8f0) dns_name: testone.cnti.com ipv4addrs: ARRAY(0x55f6da243eb0) comment: Standard Network: [TAGS: STATIC;cc.cnti.com] name: testone.cnti.com zone: cnti.com ttl: 300
In reply to printing an array reference by vedas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |