Silly question, but what port are you specifying to the script? It should be 443 for it to work. I put the option for port 80 in the samples for debugging purposes for those that were willing to disable SSL and enable straight HTTP on the admin GUI for diagnostic purposes (NOT RECOMMENDED).
The default is 443 over HTTPS and that's what we recommend you use.
If you are getting a "cannot connect" error and you are using port 443, try opening a browser and try opening https://host_ip_address and see if that works. If you can get to the host_ip_address with a browser, you should be able to with the SOAP::Lite library.
If all of that looks right, make sure you have the Crypt::SSLeay module installed in your perl distribution.
-Joe