GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
PerlIO::via::Bzip2(3) User Contributed Perl Documentation PerlIO::via::Bzip2(3)

PerlIO::via::Bzip2 - PerlIO layer for Bzip2 (de)compression

    use PerlIO::via::Bzip2;
    # or
    use PerlIO::via::Bzip2 level => 9; # Maximum compression

    # Read a bzip2 compressed file from disk.
    open(my $fh, "<:via(Bzip2)", "compressed_file");
    my $uncompressed_data = <$fh>;

    # Compress data on-the-fly to a bzip2 compressed file on disk.
    open(my $fh, ">:via(Bzip2)", "compressed_file");
    print {$fh} $uncompressed_data;

    # Set compression level
    PerlIO::via::Bzip2->level(5);
    open(my $fh, ">:via(Bzip2)", "compressed_file");
    print {$fh} $uncompressed_data;

This module implements a PerlIO layer which will let you handle bzip2 compressed files transparently.

level([$level])
level sets or returns the compression level of the bzip2 library. It ranges from 1 (least compression, most efficient memory use) to 9 (best compression, most memory usage).

This parameter can also be set during using library import, using "use PerlIO::via::Bzip2 level => $level".

Using binmode() on an opened file for compression will pop (remove) the layer.

This module requires Compress::Bzip2 version 1.03.

PerlIO::via, Compress::Bzip2

Arjen Laarhoven, <arjen@cpan.org>

Copyright (C) 2005 by Arjen Laarhoven

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2005-03-04 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.