in reply to Re: Re: Re: (tye)Re: Grabbing a web page without LWP or the like
in thread Grabbing a web page without LWP or the like

And it also handles redirections correctly, it also supplies the HTTP/1.1 "Host:" header automatically, it also correctly parses HTTP/1.1 responses ("chunked" encoding types, etc.), and it automatically knows when an error condition occurs (the result will be undefined). It should detect when the resulting data was cut off in mid-stream, it will not hang indefinitely waiting for a response. It doesn't require that you know HTTP or understand what HTTP headers are. It also will do form POSTs with a very minor change.

If that's all stuff that you don't need, then you're right, you're fine going with a bare-bones IO::Socket method.

You shouldn't have to explain to anybody how to get some magic module working. Just copy the stuff over along with your script. That's what I mean when I say it's really trivial to extend a typical distribution method just one step further to include a module. And you are also right, this is a pretty trivial thing to implement without a module, but more often than not, the request is for something a bit more complicated (like parsing HTML). In cases like that, it's usually pretty easy to get something that works for the most extreme basic cases, but anything at all that falls outside of that case (HTML tags spanning lines, for example, or encompassing brackets in the tag) will break their algorithm, they end up having to do a lot more work to fix their broken code, and they end up with some monstrous piece of garbage that could have been simplified to nothing by using pre-written modules.

I realize that this doesn't necessarily apply to you, but I'm trying to explain why those people in this thread that are incessantly recommending the installation of a real module to do the job are doing that.

  • Comment on Re: Re: Re: Re: (tye)Re: Grabbing a web page without LWP or the like