in reply to socket won't let me fetch multiple web pages

Some good answers already and pg hinted at part of the problem.

Your loop will not end until end-of-file. Once you get end-of-file, you can't get more data.

A second part of the problem is that you are specifying HTTP v1.0 which doesn't support multiple requests per connection. If you specify HTTP v1.1, then you could to multiple requests per connection but you'll have to change your loop to not go all the way to end-of-file. You may also need to not use the read-line operator (<$sock>) since it will wait forever looking for a record separator and I'm not certain that HTTP v1.1 responses are guaranteed to end in a newline.

If you really want to do this, then you'll need to learn the HTTP v1.1 protocol. You can look at how LWP does this as one step in that process. Searching for "1.1" I found that LWP/Protocol/http.pm has some of the code that handles this. A simple google search, http 1.1 standard, will find you the full details of the HTTP v1.1 protocol.

Or you could just use a module that has already done all of this work for you as several others have already suggested.

                - tye