Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Basically $stuff is undef. If I use the inflate process provided in Compress::Zlib I get a status of Z_DATA_ERROR (-3). I don't see why the returned content shouldn't just decompress. I've checked the files and they are properly x-compressed. What am I missing? Does the web client not return the compressed file properly? Help!use Compress::Zlib; use LWP::UserAgent; use HTTP::Request; use strict; ....etc. my $ua = new LWP::UserAgent; $ua->proxy('http', 'http://some.proxy.com:8000/'); my $file = "somefile.Z"; my $page="http://somehost.com/$file"; my $request = new HTTP::Request("GET", $page); my $response = $ua->request($request); if($response->is_success && $response->header('Content-Encoding') = +~ /compress/){ $stuff = Compress::Zlib::uncompress($response->content_ref); } play with data...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with Uncompressing Data
by epoptai (Curate) on Apr 07, 2001 at 00:33 UTC | |
|
Re: Help with Uncompressing Data
by extremely (Priest) on Apr 07, 2001 at 00:16 UTC | |
|
Re: Help with Uncompressing Data
by kschwab (Vicar) on Apr 07, 2001 at 00:21 UTC | |
|
Re: Help with Uncompressing Data
by Anonymous Monk on Apr 07, 2001 at 00:16 UTC | |
by Anonymous Monk on Apr 07, 2001 at 00:48 UTC |