|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
How to reliably get file size after calling WWW::Mechanize->get(file)?by CoVAX (Beadle) |
| on Feb 16, 2015 at 20:59 UTC ( [id://1116927]=perlquestion: print w/replies, xml ) | Need Help?? |
|
CoVAX has asked for the wisdom of the Perl Monks concerning the following question: I have some questions about the following code. 1. How reliable is it to use the -s file test operator so soon after calling $mech->get considering the file contents may still be in a RAM buffer? (Especially for a small file (e.g. this one is 2,575 bytes).) 2. So I thought, "Can I use the size from the response header?" I read the docs about Mech's get, and HTTP::Response, but I can't figure out how to do so. 3. Should I even consider using the content-length for an accurate (reliable) measure of the file size considering the affects from gzip'ping and etc.? I.e., is -s the "only" way to get an accurate/reliable file size?
Searched for donut and crumpit. Found donate and stumbit instead.
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||