[Israel.pm] binary vectors representation

Offer Kaye oferk at oren.co.il
Sun Jun 13 08:32:19 PDT 2004


> That's not practical -- I'll still need to have the full
> blown file on disk.
>
> I thought you ment that I can get compression on the fly and
> then extact one "item" at a time without needing to extract
> the whole file.
>

I thought you already had the data- why do you need "on the fly
compression"?
Anyway, assuming you have the compressed file infile.bz2 you could do
something like:

open(IN,"bzcat infile2.bz2 | ") or die "Couldn't pipe stdout from bzcat
infile.bz2: $!\n";
while(<IN>) {
   # do your stuff...
}
close(IN) or die "very close pipe from bzcat: $!\n";

You can also use this module:
http://search.cpan.org/dist/Compress-Bzip2/
if you prefer a more perlish interface.

----------------------------------
Offer Kaye




More information about the Perl mailing list