in reply to Determining file size over HTTP connection

Most webservers support HEAD requests for most resources. The response to a HEAD request should be the headers for that resource without the content (response body). Most resources return a Content-length header.

Note that this is not fool-proof, but it should work on most servers and urls that reference static files.

If you have the lwp command line tools installed, you can do:

> lwp-request -m HEAD http://example.com
On the command line to see the servers' response.

LWP::Simple has an head() function, which returns the content-length as the second return value.