sugarkannan has asked for the wisdom of the Perl Monks concerning the following question:
How to zip and unzip a page in a subroutine ?? When i execute the following code placed in a subroutine, the below error occurs :my $content = get $regd_web_url;
-Regards#--------------Zipping n Unzipping is done here # download page section first zip then unzip my %headers = ('Accept-Encoding' => ' gzip;deflate'); my $response = $ua->get($regd_web_url, %headers); my $content = $response->content; if(my $encoding = ($response->content_encoding)) { $content = Compress::Zlib::memGunzip($data) if $encoding =~ /gzip/i; $content = Compress::Zlib::uncompress($data) if $encoding =~ /deflate/ +i; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to zip and unzip a page in a subroutine ??
by tirwhan (Abbot) on Dec 19, 2005 at 13:50 UTC | |
|
Re: How to zip and unzip a page in a subroutine ??
by matija (Priest) on Dec 19, 2005 at 13:48 UTC | |
by Perl Mouse (Chaplain) on Dec 19, 2005 at 14:19 UTC | |
|
Re: How to zip and unzip a page in a subroutine ??
by Perl Mouse (Chaplain) on Dec 19, 2005 at 13:50 UTC |