How can I accept gzip-compressed content using LWP::UserAgent?
问题 I am fetching some pages over the Web using Perl's LWP::UserAgent and would like to be as polite as possible. By default, LWP::UserAgent does not seamlessly handle compressed content via gzip. Is there an easy way to make it do so, to save everyone some bandwidth? 回答1: LWP has this capability built in, thanks to HTTP::Message. But it's a bit hidden. First make sure you have Compress::Zlib installed so you can handle gzip . HTTP::Message::decodable() will output a list of allowed encodings