Forum Discussion
Charles_Harris
Nimbostratus
Jan 13, 2006Perl Scripting (iControl) error handling...
Hi All,
I'm currently writting my first iControl based app using perl to monitor / react to a very simple scenario but I've come across a problem and I'm stumped.....
How can I han...
Jan 13, 2006
The only way I know how to do is is by wrapping the code with an eval
http://perldoc.perl.org/functions/eval.html
Click here
Here's some sample code showing how you can use it:
----------------------------------------------------------------------------
listPools
----------------------------------------------------------------------------
sub listPools()
{
eval {
$soapResponse = $Pool->get_list();
};
if ( $@ )
{
print "Error occurred\n";
print "Error details: $@\n";
}
else
{
&checkResponse($soapResponse);
my @pool_list = @{$soapResponse->result};
print "Available Pools:\n";
foreach $pool (@pool_list)
{
print " $pool\n";
}
}
}
-Joe
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