> From: "Shishir K. Singh" <[EMAIL PROTECTED]> > > I have to get the size and last modified date of a remote file via > > URL without reading in the whole file. I have gone through > > LWP::UserAgent but couldn't make much headway. Any > pointers on how to > > do it would be appreciated. > This could be tricky, The HEAD method would be the most likely canidate but It may or may not give you this info. Do you want the META tag info or the info you'd get from stat()?
You may need to look at Net::FTP; Or you could set up a script on the remote site that can do stat() on the local file and return the dat in a usable format. http://domain.com/file.cgi : use CGI qw(:standard); my $domain = 'domain.com'; my $www_root = '/home/foo/oublic_html'; my $req_file = param('url'); my($prot,$path) = split(/$domain/, $req_file); my @stat = stat("$www_root/$path"); print header(); if(@stat) { print "$stat[7]:$stat[9]"; } else { print "File Err"; } On your site with LWP: GET("http://domain.com/file.cgi?url=http://domain.com/home.html"); if($res !~ /File Err/) { my($size,$modtime) = split(/:/, $res); } HTH DMuey -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]