Re: Frontier Bug?

"Ken MacLeod" <[email protected]>
Newsgroups gmane.text.xml.rpc.specification
Message-ID <[email protected]>
On 5/18/06, Paul Kist <[email protected]> wrote:
> I'm using Frontier's
> implementation of XML-RPC and has worked well so far.  I'm finding that
> nested structs and arrays are giving me problems.  I'm wondering if there
> are known bugs when dealing with nested arrays/structs.  For example:
>
> %sample = (pi=>("2","3"), "nested struct"=>{'welcome'=>"to the jungle"});
> return {'biweek' => $bi_week, 'mortHash' => %sample};

This is a Perl syntax problem.  You're passing a local hash (%sample)
when you should be passing a hash reference.  You can fix this in
either of two ways:

Use a scalar to hold the hash reference:

    $sample = { .... };
     return { 'mortHash' => $sample };

or pass a hash reference to your local hash:

    %sample = ( .... );
    return { 'mortHash' => \%sample };

Note the \% to get the reference to the hash and the use of { } for an
anonymous hash vs. ( ) for a list assignment to the local hash.

Check out the Perl docs on 'perllol', 'perlref', and 'perldata'.

  -- Ken


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xml-rpc/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.