Reading gzip line from line on a mac

Viewed 371

I have a gargantuan .gz file that I can read on Perl/Linux via

open my $zc, 'zcat GCF_000001405.25.gz|';

but when I run this code on a Mac (Perl 5.32.1) I get an error:

zcat: can't stat: GCF_000001405.25.gz (GCF_000001405.25.gz.Z): No such file or directory

so following https://serverfault.com/questions/570024/zcat-gzcat-works-in-linux-not-on-osx-general-linux-osx-compatibility

I tried

open my $zc, 'zcat < GCF_000001405.25.gz';

but this gives the error:

readline() on closed filehandle $zc at split.by.chr.pl line 32

I am aware of Compress::Zlib but it is very slow How to read data in .gz file very fast in perl programming

How can I change the open line in my perl script so that it will work on a Mac?

1 Answers
Related