in reply to $! and $@ peculiarities

I won't comment on the difference between $! and $@, because others have done a better job than I could do. I would like to recommend that you take a look at SOAP::Lite. It can be used to create both clients and servers (as standalone or as CGI). It moves you higher up the protocol stack, but it should eliminate your problems.

You can pass any native Perl value through. It handles converting it to and from SOAP formats. You can pass XML through as a string or if your XML is based on Perl arrays or hashes you can pass those right through instead. In one of my programs it removed a hundred or more lines of Perl code on the client and replace it with about 10 lines (much easier to maintain..:). It also has a compression option which can save bandwidth.

The SOAP::Lite Cookbook can be found here if you are interested.

Cheers,

John