我尝试处理以下由get_pool_member_object_status_($pool)
$VAR1 = [
[
bless( [
bless( {
'member' => bless( {
'address' => '192.168.100.141',
'port' => '80'
}, 'Common::IPPortDefinition' ),
'object_status' => bless( {
'availability_status' => 'AVAILABILITY_STATUS_GREEN',
'status_description' => 'Pool member is available',
'enabled_status' => 'ENABLED_STATUS_ENABLED'
}, 'LocalLB::ObjectStatus' )
}, 'LocalLB::PoolMember::MemberObjectStatus' ),
bless( {
'member' => bless( {
'address' => '192.168.100.142',
'port' => '80'
}, 'Common::IPPortDefinition' ),
'object_status' => bless( {
'availability_status' => 'AVAILABILITY_STATUS_GREEN',
'status_description' => 'Pool member is available',
'enabled_status' => 'ENABLED_STATUS_ENABLED'
}, 'LocalLB::ObjectStatus' )
}, 'LocalLB::PoolMember::MemberObjectStatus' ),
bless( {
'member' => bless( {
'address' => '192.168.100.143',
'port' => '80'
}, 'Common::IPPortDefinition' ),
'object_status' => bless( {
'availability_status' => 'AVAILABILITY_STATUS_GREEN',
'status_description' => 'Pool member is available',
'enabled_status' => 'ENABLED_STATUS_ENABLED'
}, 'LocalLB::ObjectStatus' )
}, 'LocalLB::PoolMember::MemberObjectStatus' ),
bless( {
'member' => bless( {
'address' => '192.168.100.144',
'port' => '80'
}, 'Common::IPPortDefinition' ),
'object_status' => bless( {
'availability_status' => 'AVAILABILITY_STATUS_GREEN',
'status_description' => 'Pool member is available',
'enabled_status' => 'ENABLED_STATUS_ENABLED'
}, 'LocalLB::ObjectStatus' )
}, 'LocalLB::PoolMember::MemberObjectStatus' )
], 'LocalLB::PoolMember::MemberObjectStatus[]' )
]
];
我无法弄清楚这应该如何工作。我尝试了 perldsc 的几个示例。那里的示例主要涉及哈希数组。但是上面的数组是......?我什至不知道这是什么类型的数组。有人可以指出我正确的方向吗?
"object_status"->"availability_status"
例如, 我如何访问"member"->"address"
谢谢辛巴克。这是我得到的输出Data::Printer:
[
[0] [
[0] LocalLB::PoolMember::MemberObjectStatus[] {
public methods (0)
private methods (0)
internals: [
[0] LocalLB::PoolMember::MemberObjectStatus,
[1] LocalLB::PoolMember::MemberObjectStatus,
[2] LocalLB::PoolMember::MemberObjectStatus,
[3] LocalLB::PoolMember::MemberObjectStatus
]
}
]
]