我试图说明如何在阵列中贬低价值,但已经到了死端,我曾试图研究这一问题,但需要一些帮助。
• 收集一些数据,从英正统数据库中收集,并试图在结果中搜索,以找到东道国入境的玉米地址。
use strict;
use Data::Dumper;
my @results = $session->get(
object => "Infoblox::DNS::Host",
name => "test.com.au",
ipv4addrs => ".*.",
view => "external"
);
使用_->美元的数据结构的高水平Im de-referencing;ipv4addrs 然后使用以下代码对产出进行对比:
foreach (@results) {
my @search = $_->ipv4addrs;
foreach (@search) {
print Dumper($_) . "
";
}
}
使用数据印刷以下产出:
$VAR1 = [
bless( {
network => 111.111.111.0/25 ,
options => [],
dynamic => false ,
__version => 4.2r5-5-68691 ,
VIEW_FUNCTION => {
remove => .com.infoblox.perl_api.Infoblox.DHCP.remove_fixed_address ,
search => .com.infoblox.perl_api.Infoblox.DHCP.search_fixed_address ,
add => .com.infoblox.perl_api.Infoblox.DHCP.insert_fixed_address ,
add_using_template => .com.infoblox.perl_api.Infoblox.DHCP.insert_fixed_address_using_template ,
get => .com.infoblox.perl_api.Infoblox.DHCP.get_fixed_address ,
modify => .com.infoblox.perl_api.Infoblox.DHCP.modify_fixed_address
},
ipv4addr => 111.111.111.111 ,
match_client => MAC ,
mac => 00:11:00:11:00:11 ,
disable => false ,
__type => .com.infoblox.perl_api.Infoblox.DHCP.FixedAddr
}, Infoblox::DHCP::FixedAddr )
];
但是,如果我尝试使用_->mac在 for(@searh)坡道内打字,我就错了:
"Can t call method "mac" on unblessed reference at ./connect_test.pl line nn."
我的编码技能此时失败,任何信息或方向都会受到高度赞赏。