Forum Discussion
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