If the SOAP example I gave doesn't authenticate properly, try providing your own cookie instead of reading from an existing cookie file.
my $cookie = HTTP::Cookies->new;
$cookie->set_cookie(0, user => bakeUserCookie($uid, $pass), '/', $host);
sub bakeUserCookie {
my($uid, $passwd) = @_;
my $cookie = $uid . '::' . md5_hex($passwd);
$cookie =~ s/(.)/sprintf("%%%02x", ord($1))/ge;
$cookie =~ s/%/%25/g;
return $cookie;
}