#--------------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; }