in reply to reading file size of web images
If you only want the file size, you want to check the header of the reply that the server sends to you. The LWP::Simple module has a very convenient method, unimaginatively called head, which does Just That:
use strict; use LWP::Simple; my $url = 'http://xxxxx.xxx/xxxxxx/xxxxx/xxxx.gif'; printf "$url : %s bytes", ((head $url)[1]);
|
|---|