Forum Discussion
tbledsoe_90582
Aug 19, 2011Nimbostratus
perl error with icontrol
I'm just learning iControl so I'm grabbing published code and trying to reuse it for my own purposes.
I'm trying to parse LocalLB::PoolMember::get_monitor_association
So I hacked a similar query which works:
sub GetPoolStatus()
{
my $soapResponse = $Pool->get_object_status (
SOAP::Data->name(pool_names => [&GetVSPoolList()]) );
my @pool_statuses = @{$soapResponse->result};
return @pool_statuses;
}
To yield:
sub getPoolMemberMonitors()
{
my $soapResponse = $PoolMember->get_monitor_association (
SOAP::Data->name(pool_names => [&GetVSPoolList()]) );
my @poolmember_statuses = @{$soapResponse->result};
return @poolmember_statuses;
}
When I call this object with:
@pool_monitorsAofA = getPoolMemberMonitors();
All this XML flows out onto the screen. No other call does this. If I comment out @pool_monitorsAofA, the problem goes away.
Any ideas what the problem could be?
Thanks.
TB
- Try putting an & before the method call. In perl, you need to do this when the method returns a parameter
@pool_monitorsAofA = &getPoolMemberMonitors()
- tbledsoe_90582NimbostratusThat worked!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects