1package IO::Uncompress::Bunzip2 ; 2 3use strict ; 4use warnings; 5use bytes; 6 7use IO::Compress::Base::Common 2.084 qw(:Status ); 8 9use IO::Uncompress::Base 2.084 ; 10use IO::Uncompress::Adapter::Bunzip2 2.084 ; 11 12require Exporter ; 13our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bunzip2Error); 14 15$VERSION = '2.084'; 16$Bunzip2Error = ''; 17 18@ISA = qw(IO::Uncompress::Base Exporter); 19@EXPORT_OK = qw( $Bunzip2Error bunzip2 ) ; 20#%EXPORT_TAGS = %IO::Uncompress::Base::EXPORT_TAGS ; 21push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; 22#Exporter::export_ok_tags('all'); 23 24 25sub new 26{ 27 my $class = shift ; 28 my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$Bunzip2Error); 29 30 $obj->_create(undef, 0, @_); 31} 32 33sub bunzip2 34{ 35 my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$Bunzip2Error); 36 return $obj->_inf(@_); 37} 38 39sub getExtraParams 40{ 41 return ( 42 'verbosity' => [IO::Compress::Base::Common::Parse_boolean, 0], 43 'small' => [IO::Compress::Base::Common::Parse_boolean, 0], 44 ); 45} 46 47 48sub ckParams 49{ 50 my $self = shift ; 51 my $got = shift ; 52 53 return 1; 54} 55 56sub mkUncomp 57{ 58 my $self = shift ; 59 my $got = shift ; 60 61 my $magic = $self->ckMagic() 62 or return 0; 63 64 *$self->{Info} = $self->readHeader($magic) 65 or return undef ; 66 67 my $Small = $got->getValue('small'); 68 my $Verbosity = $got->getValue('verbosity'); 69 70 my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Bunzip2::mkUncompObject( 71 $Small, $Verbosity); 72 73 return $self->saveErrorString(undef, $errstr, $errno) 74 if ! defined $obj; 75 76 *$self->{Uncomp} = $obj; 77 78 return 1; 79 80} 81 82 83sub ckMagic 84{ 85 my $self = shift; 86 87 my $magic ; 88 $self->smartReadExact(\$magic, 4); 89 90 *$self->{HeaderPending} = $magic ; 91 92 return $self->HeaderError("Header size is " . 93 4 . " bytes") 94 if length $magic != 4; 95 96 return $self->HeaderError("Bad Magic.") 97 if ! isBzip2Magic($magic) ; 98 99 100 *$self->{Type} = 'bzip2'; 101 return $magic; 102} 103 104sub readHeader 105{ 106 my $self = shift; 107 my $magic = shift ; 108 109 $self->pushBack($magic); 110 *$self->{HeaderPending} = ''; 111 112 113 return { 114 'Type' => 'bzip2', 115 'FingerprintLength' => 4, 116 'HeaderLength' => 4, 117 'TrailerLength' => 0, 118 'Header' => '$magic' 119 }; 120 121} 122 123sub chkTrailer 124{ 125 return STATUS_OK; 126} 127 128 129 130sub isBzip2Magic 131{ 132 my $buffer = shift ; 133 return $buffer =~ /^BZh\d$/; 134} 135 1361 ; 137 138__END__ 139 140 141=head1 NAME 142 143IO::Uncompress::Bunzip2 - Read bzip2 files/buffers 144 145=head1 SYNOPSIS 146 147 use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; 148 149 my $status = bunzip2 $input => $output [,OPTS] 150 or die "bunzip2 failed: $Bunzip2Error\n"; 151 152 my $z = new IO::Uncompress::Bunzip2 $input [OPTS] 153 or die "bunzip2 failed: $Bunzip2Error\n"; 154 155 $status = $z->read($buffer) 156 $status = $z->read($buffer, $length) 157 $status = $z->read($buffer, $length, $offset) 158 $line = $z->getline() 159 $char = $z->getc() 160 $char = $z->ungetc() 161 $char = $z->opened() 162 163 $data = $z->trailingData() 164 $status = $z->nextStream() 165 $data = $z->getHeaderInfo() 166 $z->tell() 167 $z->seek($position, $whence) 168 $z->binmode() 169 $z->fileno() 170 $z->eof() 171 $z->close() 172 173 $Bunzip2Error ; 174 175 # IO::File mode 176 177 <$z> 178 read($z, $buffer); 179 read($z, $buffer, $length); 180 read($z, $buffer, $length, $offset); 181 tell($z) 182 seek($z, $position, $whence) 183 binmode($z) 184 fileno($z) 185 eof($z) 186 close($z) 187 188=head1 DESCRIPTION 189 190This module provides a Perl interface that allows the reading of 191bzip2 files/buffers. 192 193For writing bzip2 files/buffers, see the companion module IO::Compress::Bzip2. 194 195=head1 Functional Interface 196 197A top-level function, C<bunzip2>, is provided to carry out 198"one-shot" uncompression between buffers and/or files. For finer 199control over the uncompression process, see the L</"OO Interface"> 200section. 201 202 use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; 203 204 bunzip2 $input_filename_or_reference => $output_filename_or_reference [,OPTS] 205 or die "bunzip2 failed: $Bunzip2Error\n"; 206 207The functional interface needs Perl5.005 or better. 208 209=head2 bunzip2 $input_filename_or_reference => $output_filename_or_reference [, OPTS] 210 211C<bunzip2> expects at least two parameters, 212C<$input_filename_or_reference> and C<$output_filename_or_reference>. 213 214=head3 The C<$input_filename_or_reference> parameter 215 216The parameter, C<$input_filename_or_reference>, is used to define the 217source of the compressed data. 218 219It can take one of the following forms: 220 221=over 5 222 223=item A filename 224 225If the <$input_filename_or_reference> parameter is a simple scalar, it is 226assumed to be a filename. This file will be opened for reading and the 227input data will be read from it. 228 229=item A filehandle 230 231If the C<$input_filename_or_reference> parameter is a filehandle, the input 232data will be read from it. The string '-' can be used as an alias for 233standard input. 234 235=item A scalar reference 236 237If C<$input_filename_or_reference> is a scalar reference, the input data 238will be read from C<$$input_filename_or_reference>. 239 240=item An array reference 241 242If C<$input_filename_or_reference> is an array reference, each element in 243the array must be a filename. 244 245The input data will be read from each file in turn. 246 247The complete array will be walked to ensure that it only 248contains valid filenames before any data is uncompressed. 249 250=item An Input FileGlob string 251 252If C<$input_filename_or_reference> is a string that is delimited by the 253characters "<" and ">" C<bunzip2> will assume that it is an 254I<input fileglob string>. The input is the list of files that match the 255fileglob. 256 257See L<File::GlobMapper|File::GlobMapper> for more details. 258 259=back 260 261If the C<$input_filename_or_reference> parameter is any other type, 262C<undef> will be returned. 263 264=head3 The C<$output_filename_or_reference> parameter 265 266The parameter C<$output_filename_or_reference> is used to control the 267destination of the uncompressed data. This parameter can take one of 268these forms. 269 270=over 5 271 272=item A filename 273 274If the C<$output_filename_or_reference> parameter is a simple scalar, it is 275assumed to be a filename. This file will be opened for writing and the 276uncompressed data will be written to it. 277 278=item A filehandle 279 280If the C<$output_filename_or_reference> parameter is a filehandle, the 281uncompressed data will be written to it. The string '-' can be used as 282an alias for standard output. 283 284=item A scalar reference 285 286If C<$output_filename_or_reference> is a scalar reference, the 287uncompressed data will be stored in C<$$output_filename_or_reference>. 288 289=item An Array Reference 290 291If C<$output_filename_or_reference> is an array reference, 292the uncompressed data will be pushed onto the array. 293 294=item An Output FileGlob 295 296If C<$output_filename_or_reference> is a string that is delimited by the 297characters "<" and ">" C<bunzip2> will assume that it is an 298I<output fileglob string>. The output is the list of files that match the 299fileglob. 300 301When C<$output_filename_or_reference> is an fileglob string, 302C<$input_filename_or_reference> must also be a fileglob string. Anything 303else is an error. 304 305See L<File::GlobMapper|File::GlobMapper> for more details. 306 307=back 308 309If the C<$output_filename_or_reference> parameter is any other type, 310C<undef> will be returned. 311 312=head2 Notes 313 314When C<$input_filename_or_reference> maps to multiple compressed 315files/buffers and C<$output_filename_or_reference> is 316a single file/buffer, after uncompression C<$output_filename_or_reference> will contain a 317concatenation of all the uncompressed data from each of the input 318files/buffers. 319 320=head2 Optional Parameters 321 322Unless specified below, the optional parameters for C<bunzip2>, 323C<OPTS>, are the same as those used with the OO interface defined in the 324L</"Constructor Options"> section below. 325 326=over 5 327 328=item C<< AutoClose => 0|1 >> 329 330This option applies to any input or output data streams to 331C<bunzip2> that are filehandles. 332 333If C<AutoClose> is specified, and the value is true, it will result in all 334input and/or output filehandles being closed once C<bunzip2> has 335completed. 336 337This parameter defaults to 0. 338 339=item C<< BinModeOut => 0|1 >> 340 341This option is now a no-op. All files will be written in binmode. 342 343=item C<< Append => 0|1 >> 344 345The behaviour of this option is dependent on the type of output data 346stream. 347 348=over 5 349 350=item * A Buffer 351 352If C<Append> is enabled, all uncompressed data will be append to the end of 353the output buffer. Otherwise the output buffer will be cleared before any 354uncompressed data is written to it. 355 356=item * A Filename 357 358If C<Append> is enabled, the file will be opened in append mode. Otherwise 359the contents of the file, if any, will be truncated before any uncompressed 360data is written to it. 361 362=item * A Filehandle 363 364If C<Append> is enabled, the filehandle will be positioned to the end of 365the file via a call to C<seek> before any uncompressed data is 366written to it. Otherwise the file pointer will not be moved. 367 368=back 369 370When C<Append> is specified, and set to true, it will I<append> all uncompressed 371data to the output data stream. 372 373So when the output is a filehandle it will carry out a seek to the eof 374before writing any uncompressed data. If the output is a filename, it will be opened for 375appending. If the output is a buffer, all uncompressed data will be 376appended to the existing buffer. 377 378Conversely when C<Append> is not specified, or it is present and is set to 379false, it will operate as follows. 380 381When the output is a filename, it will truncate the contents of the file 382before writing any uncompressed data. If the output is a filehandle 383its position will not be changed. If the output is a buffer, it will be 384wiped before any uncompressed data is output. 385 386Defaults to 0. 387 388=item C<< MultiStream => 0|1 >> 389 390If the input file/buffer contains multiple compressed data streams, this 391option will uncompress the whole lot as a single data stream. 392 393Defaults to 0. 394 395=item C<< TrailingData => $scalar >> 396 397Returns the data, if any, that is present immediately after the compressed 398data stream once uncompression is complete. 399 400This option can be used when there is useful information immediately 401following the compressed data stream, and you don't know the length of the 402compressed data stream. 403 404If the input is a buffer, C<trailingData> will return everything from the 405end of the compressed data stream to the end of the buffer. 406 407If the input is a filehandle, C<trailingData> will return the data that is 408left in the filehandle input buffer once the end of the compressed data 409stream has been reached. You can then use the filehandle to read the rest 410of the input file. 411 412Don't bother using C<trailingData> if the input is a filename. 413 414If you know the length of the compressed data stream before you start 415uncompressing, you can avoid having to use C<trailingData> by setting the 416C<InputLength> option. 417 418=back 419 420=head2 Examples 421 422To read the contents of the file C<file1.txt.bz2> and write the 423uncompressed data to the file C<file1.txt>. 424 425 use strict ; 426 use warnings ; 427 use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; 428 429 my $input = "file1.txt.bz2"; 430 my $output = "file1.txt"; 431 bunzip2 $input => $output 432 or die "bunzip2 failed: $Bunzip2Error\n"; 433 434To read from an existing Perl filehandle, C<$input>, and write the 435uncompressed data to a buffer, C<$buffer>. 436 437 use strict ; 438 use warnings ; 439 use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; 440 use IO::File ; 441 442 my $input = new IO::File "<file1.txt.bz2" 443 or die "Cannot open 'file1.txt.bz2': $!\n" ; 444 my $buffer ; 445 bunzip2 $input => \$buffer 446 or die "bunzip2 failed: $Bunzip2Error\n"; 447 448To uncompress all files in the directory "/my/home" that match "*.txt.bz2" and store the compressed data in the same directory 449 450 use strict ; 451 use warnings ; 452 use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; 453 454 bunzip2 '</my/home/*.txt.bz2>' => '</my/home/#1.txt>' 455 or die "bunzip2 failed: $Bunzip2Error\n"; 456 457and if you want to compress each file one at a time, this will do the trick 458 459 use strict ; 460 use warnings ; 461 use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; 462 463 for my $input ( glob "/my/home/*.txt.bz2" ) 464 { 465 my $output = $input; 466 $output =~ s/.bz2// ; 467 bunzip2 $input => $output 468 or die "Error compressing '$input': $Bunzip2Error\n"; 469 } 470 471=head1 OO Interface 472 473=head2 Constructor 474 475The format of the constructor for IO::Uncompress::Bunzip2 is shown below 476 477 my $z = new IO::Uncompress::Bunzip2 $input [OPTS] 478 or die "IO::Uncompress::Bunzip2 failed: $Bunzip2Error\n"; 479 480Returns an C<IO::Uncompress::Bunzip2> object on success and undef on failure. 481The variable C<$Bunzip2Error> will contain an error message on failure. 482 483If you are running Perl 5.005 or better the object, C<$z>, returned from 484IO::Uncompress::Bunzip2 can be used exactly like an L<IO::File|IO::File> filehandle. 485This means that all normal input file operations can be carried out with 486C<$z>. For example, to read a line from a compressed file/buffer you can 487use either of these forms 488 489 $line = $z->getline(); 490 $line = <$z>; 491 492The mandatory parameter C<$input> is used to determine the source of the 493compressed data. This parameter can take one of three forms. 494 495=over 5 496 497=item A filename 498 499If the C<$input> parameter is a scalar, it is assumed to be a filename. This 500file will be opened for reading and the compressed data will be read from it. 501 502=item A filehandle 503 504If the C<$input> parameter is a filehandle, the compressed data will be 505read from it. 506The string '-' can be used as an alias for standard input. 507 508=item A scalar reference 509 510If C<$input> is a scalar reference, the compressed data will be read from 511C<$$input>. 512 513=back 514 515=head2 Constructor Options 516 517The option names defined below are case insensitive and can be optionally 518prefixed by a '-'. So all of the following are valid 519 520 -AutoClose 521 -autoclose 522 AUTOCLOSE 523 autoclose 524 525OPTS is a combination of the following options: 526 527=over 5 528 529=item C<< AutoClose => 0|1 >> 530 531This option is only valid when the C<$input> parameter is a filehandle. If 532specified, and the value is true, it will result in the file being closed once 533either the C<close> method is called or the IO::Uncompress::Bunzip2 object is 534destroyed. 535 536This parameter defaults to 0. 537 538=item C<< MultiStream => 0|1 >> 539 540Allows multiple concatenated compressed streams to be treated as a single 541compressed stream. Decompression will stop once either the end of the 542file/buffer is reached, an error is encountered (premature eof, corrupt 543compressed data) or the end of a stream is not immediately followed by the 544start of another stream. 545 546This parameter defaults to 0. 547 548=item C<< Prime => $string >> 549 550This option will uncompress the contents of C<$string> before processing the 551input file/buffer. 552 553This option can be useful when the compressed data is embedded in another 554file/data structure and it is not possible to work out where the compressed 555data begins without having to read the first few bytes. If this is the 556case, the uncompression can be I<primed> with these bytes using this 557option. 558 559=item C<< Transparent => 0|1 >> 560 561If this option is set and the input file/buffer is not compressed data, 562the module will allow reading of it anyway. 563 564In addition, if the input file/buffer does contain compressed data and 565there is non-compressed data immediately following it, setting this option 566will make this module treat the whole file/buffer as a single data stream. 567 568This option defaults to 1. 569 570=item C<< BlockSize => $num >> 571 572When reading the compressed input data, IO::Uncompress::Bunzip2 will read it in 573blocks of C<$num> bytes. 574 575This option defaults to 4096. 576 577=item C<< InputLength => $size >> 578 579When present this option will limit the number of compressed bytes read 580from the input file/buffer to C<$size>. This option can be used in the 581situation where there is useful data directly after the compressed data 582stream and you know beforehand the exact length of the compressed data 583stream. 584 585This option is mostly used when reading from a filehandle, in which case 586the file pointer will be left pointing to the first byte directly after the 587compressed data stream. 588 589This option defaults to off. 590 591=item C<< Append => 0|1 >> 592 593This option controls what the C<read> method does with uncompressed data. 594 595If set to 1, all uncompressed data will be appended to the output parameter 596of the C<read> method. 597 598If set to 0, the contents of the output parameter of the C<read> method 599will be overwritten by the uncompressed data. 600 601Defaults to 0. 602 603=item C<< Strict => 0|1 >> 604 605This option is a no-op. 606 607=item C<< Small => 0|1 >> 608 609When non-zero this options will make bzip2 use a decompression algorithm 610that uses less memory at the expense of increasing the amount of time 611taken for decompression. 612 613Default is 0. 614 615=back 616 617=head2 Examples 618 619TODO 620 621=head1 Methods 622 623=head2 read 624 625Usage is 626 627 $status = $z->read($buffer) 628 629Reads a block of compressed data (the size of the compressed block is 630determined by the C<Buffer> option in the constructor), uncompresses it and 631writes any uncompressed data into C<$buffer>. If the C<Append> parameter is 632set in the constructor, the uncompressed data will be appended to the 633C<$buffer> parameter. Otherwise C<$buffer> will be overwritten. 634 635Returns the number of uncompressed bytes written to C<$buffer>, zero if eof 636or a negative number on error. 637 638=head2 read 639 640Usage is 641 642 $status = $z->read($buffer, $length) 643 $status = $z->read($buffer, $length, $offset) 644 645 $status = read($z, $buffer, $length) 646 $status = read($z, $buffer, $length, $offset) 647 648Attempt to read C<$length> bytes of uncompressed data into C<$buffer>. 649 650The main difference between this form of the C<read> method and the 651previous one, is that this one will attempt to return I<exactly> C<$length> 652bytes. The only circumstances that this function will not is if end-of-file 653or an IO error is encountered. 654 655Returns the number of uncompressed bytes written to C<$buffer>, zero if eof 656or a negative number on error. 657 658=head2 getline 659 660Usage is 661 662 $line = $z->getline() 663 $line = <$z> 664 665Reads a single line. 666 667This method fully supports the use of the variable C<$/> (or 668C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C<English> is in use) to 669determine what constitutes an end of line. Paragraph mode, record mode and 670file slurp mode are all supported. 671 672=head2 getc 673 674Usage is 675 676 $char = $z->getc() 677 678Read a single character. 679 680=head2 ungetc 681 682Usage is 683 684 $char = $z->ungetc($string) 685 686=head2 getHeaderInfo 687 688Usage is 689 690 $hdr = $z->getHeaderInfo(); 691 @hdrs = $z->getHeaderInfo(); 692 693This method returns either a hash reference (in scalar context) or a list 694or hash references (in array context) that contains information about each 695of the header fields in the compressed data stream(s). 696 697=head2 tell 698 699Usage is 700 701 $z->tell() 702 tell $z 703 704Returns the uncompressed file offset. 705 706=head2 eof 707 708Usage is 709 710 $z->eof(); 711 eof($z); 712 713Returns true if the end of the compressed input stream has been reached. 714 715=head2 seek 716 717 $z->seek($position, $whence); 718 seek($z, $position, $whence); 719 720Provides a sub-set of the C<seek> functionality, with the restriction 721that it is only legal to seek forward in the input file/buffer. 722It is a fatal error to attempt to seek backward. 723 724Note that the implementation of C<seek> in this module does not provide 725true random access to a compressed file/buffer. It works by uncompressing 726data from the current offset in the file/buffer until it reaches the 727uncompressed offset specified in the parameters to C<seek>. For very small 728files this may be acceptable behaviour. For large files it may cause an 729unacceptable delay. 730 731The C<$whence> parameter takes one the usual values, namely SEEK_SET, 732SEEK_CUR or SEEK_END. 733 734Returns 1 on success, 0 on failure. 735 736=head2 binmode 737 738Usage is 739 740 $z->binmode 741 binmode $z ; 742 743This is a noop provided for completeness. 744 745=head2 opened 746 747 $z->opened() 748 749Returns true if the object currently refers to a opened file/buffer. 750 751=head2 autoflush 752 753 my $prev = $z->autoflush() 754 my $prev = $z->autoflush(EXPR) 755 756If the C<$z> object is associated with a file or a filehandle, this method 757returns the current autoflush setting for the underlying filehandle. If 758C<EXPR> is present, and is non-zero, it will enable flushing after every 759write/print operation. 760 761If C<$z> is associated with a buffer, this method has no effect and always 762returns C<undef>. 763 764B<Note> that the special variable C<$|> B<cannot> be used to set or 765retrieve the autoflush setting. 766 767=head2 input_line_number 768 769 $z->input_line_number() 770 $z->input_line_number(EXPR) 771 772Returns the current uncompressed line number. If C<EXPR> is present it has 773the effect of setting the line number. Note that setting the line number 774does not change the current position within the file/buffer being read. 775 776The contents of C<$/> are used to determine what constitutes a line 777terminator. 778 779=head2 fileno 780 781 $z->fileno() 782 fileno($z) 783 784If the C<$z> object is associated with a file or a filehandle, C<fileno> 785will return the underlying file descriptor. Once the C<close> method is 786called C<fileno> will return C<undef>. 787 788If the C<$z> object is associated with a buffer, this method will return 789C<undef>. 790 791=head2 close 792 793 $z->close() ; 794 close $z ; 795 796Closes the output file/buffer. 797 798For most versions of Perl this method will be automatically invoked if 799the IO::Uncompress::Bunzip2 object is destroyed (either explicitly or by the 800variable with the reference to the object going out of scope). The 801exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In 802these cases, the C<close> method will be called automatically, but 803not until global destruction of all live objects when the program is 804terminating. 805 806Therefore, if you want your scripts to be able to run on all versions 807of Perl, you should call C<close> explicitly and not rely on automatic 808closing. 809 810Returns true on success, otherwise 0. 811 812If the C<AutoClose> option has been enabled when the IO::Uncompress::Bunzip2 813object was created, and the object is associated with a file, the 814underlying file will also be closed. 815 816=head2 nextStream 817 818Usage is 819 820 my $status = $z->nextStream(); 821 822Skips to the next compressed data stream in the input file/buffer. If a new 823compressed data stream is found, the eof marker will be cleared and C<$.> 824will be reset to 0. 825 826Returns 1 if a new stream was found, 0 if none was found, and -1 if an 827error was encountered. 828 829=head2 trailingData 830 831Usage is 832 833 my $data = $z->trailingData(); 834 835Returns the data, if any, that is present immediately after the compressed 836data stream once uncompression is complete. It only makes sense to call 837this method once the end of the compressed data stream has been 838encountered. 839 840This option can be used when there is useful information immediately 841following the compressed data stream, and you don't know the length of the 842compressed data stream. 843 844If the input is a buffer, C<trailingData> will return everything from the 845end of the compressed data stream to the end of the buffer. 846 847If the input is a filehandle, C<trailingData> will return the data that is 848left in the filehandle input buffer once the end of the compressed data 849stream has been reached. You can then use the filehandle to read the rest 850of the input file. 851 852Don't bother using C<trailingData> if the input is a filename. 853 854If you know the length of the compressed data stream before you start 855uncompressing, you can avoid having to use C<trailingData> by setting the 856C<InputLength> option in the constructor. 857 858=head1 Importing 859 860No symbolic constants are required by this IO::Uncompress::Bunzip2 at present. 861 862=over 5 863 864=item :all 865 866Imports C<bunzip2> and C<$Bunzip2Error>. 867Same as doing this 868 869 use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; 870 871=back 872 873=head1 EXAMPLES 874 875=head2 Working with Net::FTP 876 877See L<IO::Compress::FAQ|IO::Compress::FAQ/"Compressed files and Net::FTP"> 878 879=head1 SEE ALSO 880 881L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Compress::Lzma>, L<IO::Uncompress::UnLzma>, L<IO::Compress::Xz>, L<IO::Uncompress::UnXz>, L<IO::Compress::Lzip>, L<IO::Uncompress::UnLzip>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Compress::Zstd>, L<IO::Uncompress::UnZstd>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress> 882 883L<IO::Compress::FAQ|IO::Compress::FAQ> 884 885L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>, 886L<Archive::Tar|Archive::Tar>, 887L<IO::Zlib|IO::Zlib> 888 889The primary site for the bzip2 program is L<http://www.bzip.org>. 890 891See the module L<Compress::Bzip2|Compress::Bzip2> 892 893=head1 AUTHOR 894 895This module was written by Paul Marquess, C<pmqs@cpan.org>. 896 897=head1 MODIFICATION HISTORY 898 899See the Changes file. 900 901=head1 COPYRIGHT AND LICENSE 902 903Copyright (c) 2005-2019 Paul Marquess. All rights reserved. 904 905This program is free software; you can redistribute it and/or 906modify it under the same terms as Perl itself. 907 908