in reply to Re: Help With Parsing XML format / Hash of Hashes
in thread Help With Parsing XML format / Hash of Hashes

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>";