my $result = SOAP::Lite -> uri('http://www.example.com/Protected') -> proxy('http://www.example.com/soap.cgi') -> fetchdata($name, $pass, @request) -> result; #### package Protected; sub fetchdata { my $pkg = shift; my $name = shift; my $pass = shift; #check the $name and $pass and process @request # or send an response indicating authentication error }