I think adrianh explained what's going on with the method calls rather well, but if you don't feel comfortable with that syntax (I personally found it confusing when I started out), you can do:

my $soap = SOAP::Lite->new( uri => 'http://www.soaplite.com/Demo', proxy => 'http://services.soaplite.com/hibye.cgi', ); my $soap_result = $soap->hi(); print $soap_result->result();

(Yes, the result of a soap call isn't actually the result of the value that was returned by the method... it's actually a SOAP::SOM object)

As for the second part of your question, take a look at what '+autodispatch' does in the SOAP::Lite documentation.


In reply to Re: Perl syntax question by jhourcle
in thread Syntax used by SOAP::Lite by smeenz

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.