Question

While trying to get a webpage using LWP::UserAgent I am getting the following error

X-Died: Missing newline after chunk data: 'OeXk0Yk1iRVhX.<Lot of this>...pOnR5cGU9InhzOnN' at /usr/share/perl5/Net/HTTP/Methods.pm line 481.

To make things worse, it doesn't show up all the time.I am able to 'Get' the web page properly many times. Could someone shed some light on the issue ? Is it a bug in the Perl Module ? Is there a work around for this issue ?

Was it helpful?

Solution

This error is the cause of a bug likely from your version of Net::HTTP. There have been similar cases of this in the past. Download the newest version of this from CPAN or download the patch to fix this.

This bug could also be related to LWP::UserAgent cuts chunked response sent through HTTPS

OTHER TIPS

I'm not sure that it would help your particular script, but maybe try wrapping your LWP get with the
eval { my $lwpget = get($url) } operator.

And then perhaps evaluate the $scalar afterwards with

if ($lwpget) { subroutine_do_something($lwpget); }

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top