What happens if you turn off buffering? I also agree with Karsten S. in checking http headers for erroneous codes. Finally, I also tried storing the contents in an array to see what happens.
To disable buffering, you can simply put $|++
at the top of your script after your use
statements. Again, a shot in the dark.
To learn http headers, you can use CGI
. Here is a small site with a good example of how to get the headers from the request:
http://www.velocityreviews.com/forums/t24118-re-lwp-simple-header-information-problems.html
Finally, try using the @contents
array to store content from the web server instead of the $contents
scalar. I used to have a time when something is being transferred from a remote server, which Perl incorrectly interprets as a list. I am not sure if LWP::Simple
is responsible for these times, but cannot stop trying. You can only get one piece of data, and the rest will either be overwritten or ignored altogether. Placing data in an array can help determine if this is happening.
source share