my $service; eval { $service = SOAP::Lite -> service('http://server/function.asmx?WSDL'); } || soapGetBad(); # $@ will have the error message, perldoc -f eval