Greetings esteemed Monks! I am writing a small bit of SOAP client code using SOAP::Lite though this is not necessarily a SOAP question. I wrote a small subroutine to make life easier for the .NET eccentricities when using SOAP::Lite. When I uncomment the commented lines below and comment the next two it works fine. However when I run it as below it fails. I can't see the difference. Is it something with references?
use SOAP::Lite; use strict; my $uri = "test_uri; my $proxy = "test_proxy"; my $service = SOAP::Lite ->uri($uri) ->proxy($proxy) ->on_action(sub{sprintf '%s/%s', @_ }); my $uname = "testuser"; my $pwd = "testpwd"; #my $username = SOAP::Data->name(username => $uname)->type('string')-> +uri($uri); #my $password = SOAP::Data->name(password => $pwd)->type('string')->ur +i($uri); my $username = dotnet_stuff("username", $uname); my $password = dotnet_stuff("password", $pwd); my $test = $service->Login($username, $password); print $test->result(); if($test->fault()) { my $error = join (', ', $test->faultcode, $test->faultstring); print "$error"; } sub dotnet_stuff { my $name = pop(@_); my $value = pop(@_); my $soap = SOAP::Data->name($name => $value)->type('string')->uri($ +uri); return $soap; }
Any help would be appreciated very much!

In reply to Subroutine Return? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.