Loading ...
Sorry, an error occurred while loading the content.

1913Question on 'Cannot encode... as hash, encode as map instead'

Expand Messages
  • Ron Murphy
    Oct 14, 2002
      I have some code similar to
      sub foo
          my $class = shift;
          my %hash;
          $hash{""} = "emptyval";
          $hash{"bbb"}{""} = "emptybbbval";
      This prints warnings like,
      Cannot encode unnamed element as 'hash'. Will be encoded as 'map' instead
      Cannot encode 'value' element as 'hash'. Will be encoded as 'map' instead
      I see that values such as empty string do not conform to what XML wants as names, so that's fine.  The receiving SOAP::Lite client also grabs these mutated values just fine as hashes.
      My question is, what would be equivalent code I can write, in order to **encode these as map values in the first place?**  I'd rather write code that does not produce warnings (I don't want to disable warnings like these).
      If there is any documentation explaining this already, kindly point me to it.
    • Show all 2 messages in this topic