Skeeve has asked for the wisdom of the Perl Monks concerning the following question:
I'm wondering what I'm missing.
Every hour I receive a bunch of data which I write into a compressed (gzip) text file.
I collect all the 24 data deliveries into one file by simply appending to the file created in the first hour.
When I do a gunzip -c myfile.gz I can see all my data.
Whenn I open the same file with PerlIO::gzip I only get the first set of data.
Here is a small script to reproduce:
use PerlIO::gzip; open my $out, ">:gzip", "tst.gz"; print $out "111111111111111111111111\n" x 100; close $out; open my $out, ">>:gzip", "tst.gz"; print $out "222222222222222222222222\n" x 100; close $out; open my $in, "<:gzip", "tst.gz"; print while <$in>; close $in;
Question is: How can I convince perl to continue reading data?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: PerlIO::gzip can't handle appended stuff
by haukex (Archbishop) on Apr 16, 2021 at 11:56 UTC | |
by Skeeve (Parson) on Apr 16, 2021 at 12:21 UTC |