homepage Welcome to WebmasterWorld Guest from 54.167.182.81
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
How to inflate a GZIP in perl
At my provider no mod_gunzip available
jetteroheller

WebmasterWorld Senior Member jetteroheller us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3881936 posted 8:27 pm on Mar 30, 2009 (gmt 0)

Since at my content provider, mod_gunzip is not available,
I have to simulate the most important part myself.

use Compress::Zlib;

my $buffer = sub_to_laod_a_file ( "gzip compressed file" );

my $out = uncompress ( $buffer );

$buffer contains the compressed file,
but $out has 0 byte length.

What's wrong?

 

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 3881936 posted 4:12 am on Mar 31, 2009 (gmt 0)

if $out contains no content it is undefined which means an error occurred:
COMPRESS/UNCOMPRESS [search.cpan.org]

these methods are intended for ZLIB Compressed Data Format Specification [ietf.org] (RFC-1950) and you probably want something that works for GZIP file format specification [ietf.org] (RFC-1952).

GZIP INTERFACE [search.cpan.org]:
Compress::Zlib::memGunzip [search.cpan.org]

try using this instead;
$out = Compress::Zlib::memGunzip($buffer) ;

jetteroheller

WebmasterWorld Senior Member jetteroheller us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3881936 posted 6:30 am on Mar 31, 2009 (gmt 0)

Thanks! That works!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved