Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Compressing Data On The Fly

by Zaxo (Archbishop)
on May 15, 2005 at 05:24 UTC ( #457164=note: print w/replies, xml ) Need Help??


in reply to Compressing Data On The Fly

gaal++ has given you my favorite solution to this. Here's detail of how to use it:

use PerlIO::gzip; open UPLOADFILE, '>:gzip', "$upload_dir/$uldate" or die $!; # . . .
If you wish, you can add the gzip layer with binmode, instead.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: Compressing Data On The Fly
by gaal (Parson) on May 15, 2005 at 05:32 UTC
    And in reading,

    open my $fh, '<:gzip(autopop)', $file or die $!; This transparently falls back on ungzipped where the file is not compressed. There's a warning in the docs about using it, but in many cases it's an excellent tool.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://457164]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2022-08-07 22:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?