Thanks for your response. I got an error when I put in the line my $result = subReturningHashRef();
Undefined subroutine &main::subReturningHashRef called
Here is my complete code:
#!/usr/bin/perl use HTML::Template; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use SOAP::WSDL; use Data::Dumper; # config vars my $tocheck = param('text'); #my $license = '12345yourlicensekey'; my $service = 'http://ws.cdyne.com/SpellChecker/check.asmx'; my $wsdl = "$service?WSDL"; # initialise the SOAP proxy object my $soap = SOAP::WSDL->new(); $soap->wsdl($wsdl); $soap->on_action(sub { return $_[0].$_[1]; }); # uncomment if you get +a soapfault containing something like 'invalid method specification'. $soap->proxy($service); $soap->wsdlinit(caching => 1) || die "couldn't connect to soap service!"; # call the CheckTextBody method exposed by the web-service my $som = $soap->CheckTextBody( BodyText => $tocheck, LicenseKey => $license); # examine the result returned by the web-service print "Content-type: text/html\n\n"; print "<html>"; print "<head>"; print "<title>OS2 - Lab3 Project</title>"; print "</head>"; print "<body>"; print qq{<center><b><font size="+3">Online Spellchecker via SOAP and X +ML</b></center>}; print "<br>"; print qq{<form method="post" action="lab3.cgi">}; print "<table>"; print qq{<tr><td>Enter Text:</td><td>Word:</td></tr>}; print qq{<tr><td rowspan="12" valign="top"><textarea cols="45" rows="1 +2" name="text">$tocheck</textarea>}; print qq{</td><td><input type="text" name="word" value=""></td></tr>}; print qq{<tr><td>Suggestions:</td></tr>}; print qq{<tr><td rowspan="8"><select size="10">}; print qq{<option value =" ">---------------End---------------</option> +}; print qq{</select></td>}; print qq{</tr>}; print qq{<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></t +r><tr></tr><tr></tr></tr><tr></tr>}; print qq{<tr><td><input type="submit" name="submit" value="Submit">}; print qq{</td><td><input type="submit" name="Replace" value="Replace"> +</td></tr>}; print "</table>"; print "<br>"; print "<br>"; print "<b>XML Data Received:</b>"; print "<br>"; if ($som->fault) { $result = $som->faultstring; print qq{<textarea cols="55" rows="10" name="response">$result</textar +ea>}; } else { $result = Dumper($som->paramsall); #%result1 = $som->paramsall; #%result1 = $result; #$value = $result1{'body'}; $result = subReturningHashRef (); print qq{<textarea cols="45" rows="10" name="response">$result->{Missp +elledWordCount}</textarea>}; } print "<br>"; print "</form>"; print "</body>"; print "</html>";

In reply to Re^2: Help With Parsing XML format / Hash of Hashes by Anonymous Monk
in thread Help With Parsing XML format / Hash of Hashes 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.