Is there a faster solution than my actual \'zcat\' solution to gunzip files with Perl?
A little benchmark:
#!/usr/bin/perl
use strict;
use warnings;
And I also don't understand why
while (<$z>)
is slower thanwhile (my $line = $z->getline())
...
Because $z
is a self tied object, tied objects are notoriously slow, and <$z>
uses the tied object interface to call getline()
rather than directly calling the method.
Also you can try PerlIO-gzip but I suspect it won't be any/much faster than the other module.