in reply to Sending XML data is simple right?

Try this:

my $response = $browser->post($url, Content => join('', @data));

... and then read up on the fat comma (=>) operator in perlop.

What you're doing is equivalent to:

my $response = $browser->post($url, Content => $data[0], $data[1] => $data[2], $data[3] => $data[4], ... );

... which is not expected by the post method.

Update: Oops, thanks Jenda :-/

-David

Replies are listed 'Best First'.
Re^2: Sending XML data is simple right?
by Jenda (Abbot) on Nov 15, 2007 at 18:05 UTC

    This would cause the sent data to look like this

    <?xml version="1.0"?> <root> <othertag>foo</othertag> </root>
    The elements of the @data array do contain the newlines already.

    If you want to merge the array into a single string you should use join( '', @data)