Uggg, Perl has always been the easiest of our supported languages to figure out. I'll have to upgrade to the latest version of perl and try to replicate this. What platform are you on (windows, mac, linux, etc) and what is your version of perl?
As for the 401, this is the Authorization header that's passed through. Double check that parameters 3 and 4 for the script are correct and are properly escaped if they have special characters for your platform (ie. % for windows, $ for unix/etc). Just make sure that the debug print line I included above for the credentials are the same as you typed in on the browser. If you are absolutely sure you have the credentials correct, you can turn on SOAP::Lite trace debugging by switching the two use SOAP::Lite lines at the top, running the script, and then passing it along to me directly at joe at f5 dot com and I can look to make sure the headers are getting passed correctly.