- or download this
use IO::Compress::Gzip qw(gzip);
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
...
# Create some compressed data
my $gzipped ;
gzip \$data => \$gzipped ;
- or download this
my $corrupt = $gzipped;
...
gunzip \$corrupt => \$uncompressed
or print "Cannot gunzip: $GunzipError\n";
- or download this
Cannot gunzip: Inflation Error: data error
- or download this
# truncate the compressed data
my $truncated = substr($gzipped, 0, 10);
gunzip \$truncated => \$uncompressed
or print "Cannot gunzip: $GunzipError\n";
- or download this
Cannot gunzip: unexpected end of file