in reply to Re^2: curl http post using LWP::Curl
in thread curl http post using LWP::Curl

This error happens in the ->post method of LWP::Curl, a place that doesn't immediately relate to the line you posted above.

Can you please post a short, self-contained example program that reproduces the problem? Maybe part of the problem is Perl 5.8's spotty support for in-memory filehandles or something else, but without having code to easily reproduce your situation, that's hard to say.

Replies are listed 'Best First'.
Re^4: curl http post using LWP::Curl
by wanderedinn (Sexton) on Jun 28, 2016 at 19:19 UTC
    use LWP::Curl; use Net::Curl::Easy qw(:constants); my $lwpcurl = LWP::Curl->new(); my $referer = 'http://server.com/:5555'; my $post_url = 'http://userid:password@server.com:5555/receive'; open(my $fh, "<", "test.xml"); or die "can not open file ($!)"; $lwpcurl->{agent}->setopt( CURLOPT_READDATA, $fh ); $lwpcurl->{agent}->setopt( CURLOPT_HEADERDATA, ['Content-Type:text/xml +'] ); my $content = $lwpcurl->post($post_url, {}, $referer);