#!/usr/bin/perl use strict; use PerlIO::gzip; open( my $zip, "<:gzip", "bigfile.gz ) or die "$!\n"; while (<$zip>) { print if ( /some regex/ ); }