in reply to Re: Complex file manipulation challenge
in thread Complex file manipulation challenge

Nice! Note that the original problem statement includes this:

Note: Your program should work when files are much bigger than memory in your JVM and must close all open resources correctly
  • Comment on Re^2: Complex file manipulation challenge

Replies are listed 'Best First'.
Re^3: Complex file manipulation challenge
by Tux (Canon) on Aug 13, 2019 at 18:24 UTC

    I did not read the original problem statement :)

    csv (in => $fh, out => undef, on_in => sub { ... }); supports streaming and does not store in memory (other than the current record. Rewriting my version to do that can be an exercise to the reader.

    In preparation I found that PerlIO::via::gzip *only* supports open my $fh, ":via(gzip)", "file.gz"; and *not* open my $fh, ">", "file.gz"; binmode $fh, ":via(gzip)"; :( :(


    Enjoy, Have FUN! H.Merijn
      csv (in => $fh, out => undef, on_in => sub { ... }); supports streaming and does not store in memory

      Nice, good to know!

      I found that PerlIO::via::gzip *only* supports open my $fh, ":via(gzip)", "file.gz";

      Too bad, but IO::Compress::Gzip (core module) that I showed should support that AFAIK.