[EMAIL PROTECTED] wrote:
Hi,
I want to push XML data file to the XML channel, please find the code
snippet for the same.
########
#!/usr/bin/perl
use LWP::UserAgent;
my $browser = LWP::UserAgent->new;
my $url = 'http://xxx.xxx.xxx.xxx:xxxxx';
open(FILE,"display.xml");
my @data=<FILE>;
my $response = $browser->post( $url, Content => @data );
print @data;
########
When I print @data, it printing the full XML data on my console, but
doing a post like this only sends the very first XML tag, not all of the
contents in @data.
I have tried with the following methods which doesn't make any
difference in the Posted XML data, mentioned as above only very first
XML tag sent.
1)my $response = $browser->post( $url, Content => [EMAIL PROTECTED] );
2)my $response = $browser->post($url, Content => join('', @data));
3)Reading the data into a single scalar, not into an array as follows,
my $data = do {local $/; <FILE>;};
my $response = $browser->post( $url, Content => $data );
Source:http://www.perlmonks.org/?node_id=651037
Please help me on this.
You have already posted this question on PerlMonks and had comprehensive
replies. Why are you still asking the same questions? What problem
remains after you have applied the help you got there?
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/