Compress::Raw::Bzip2::FAQ -- Frequently Asked Questions about Compress::Raw::Bzip2
Common questions answered.
This module is not compatible with Unix compress.
compress
If you have the uncompress program available, you can use this to read compressed files
uncompress
open F, "uncompress -c $filename |"; while (<F>) { ...
Alternatively, if you have the gunzip program available, you can use this to read compressed files
gunzip
open F, "gunzip -c $filename |"; while (<F>) { ...
and this to write compress files, if you have the compress program available
open F, "| compress -c $filename "; print F "data"; ... close F ;
See previous FAQ item.
If the Archive::Tar module is installed and either the uncompress or gunzip programs are available, you can use one of these workarounds to read .tar.Z files.
Archive::Tar
.tar.Z
Firstly with uncompress
use strict; use warnings; use Archive::Tar; open F, "uncompress -c $filename |"; my $tar = Archive::Tar->new(*F); ...
and this with gunzip
use strict; use warnings; use Archive::Tar; open F, "gunzip -c $filename |"; my $tar = Archive::Tar->new(*F); ...
Similarly, if the compress program is available, you can use this to write a .tar.Z file
use strict; use warnings; use Archive::Tar; use IO::File; my $fh = new IO::File "| compress -c >$filename"; my $tar = Archive::Tar->new(); ... $tar->write($fh); $fh->close ;
This module does not support reading/writing zip files.
Limited support for reading/writing zip files is included with the IO::Compress::Zip and IO::Uncompress::Unzip modules.
IO::Compress::Zip
IO::Uncompress::Unzip
A full interface for manipulating zip files is available with the Archive::Zip module. You can find it on CPAN at
Archive::Zip
http://www.cpan.org/modules/by-module/Archive/Archive-Zip-*.tar.gz
Compress::Zlib, IO::Compress::Gzip, IO::Uncompress::Gunzip, IO::Compress::Deflate, IO::Uncompress::Inflate, IO::Compress::RawDeflate, IO::Uncompress::RawInflate, IO::Compress::Bzip2, IO::Uncompress::Bunzip2, IO::Compress::Lzop, IO::Uncompress::UnLzop, IO::Uncompress::AnyInflate, IO::Uncompress::AnyUncompress
Compress::Zlib::FAQ
File::GlobMapper, Archive::Zip, Archive::Tar, IO::Zlib
This module was written by Paul Marquess, pmqs@cpan.org.
See the Changes file.
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Compress::Raw::Bzip2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Compress::Raw::Bzip2
CPAN shell
perl -MCPAN -e shell install Compress::Raw::Bzip2
For more information on module installation, please visit the detailed CPAN module installation guide.