[Israel.pm] binary vectors representation

Shlomo Yona shlomo at cs.haifa.ac.il
Sun Jun 13 07:42:15 PDT 2004


On Sun, 13 Jun 2004, Offer Kaye wrote:

> I thought you already had the data- why do you need "on the fly
> compression"?

I don't want to wait till I have it all in memory and only
then write it to a file -- I'd like to write them one by
one.

> 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.

That's great, now what about on the fly extraction?


-- 
Shlomo Yona
shlomo at cs.haifa.ac.il
http://cs.haifa.ac.il/~shlomo/



More information about the Perl mailing list