http://www.perlmonks.org?node_id=999446


in reply to Random accessing a gzip file

From the manual page of IO::Uncompress::Gunzip, I read:

seek
$z->seek($position, $whence); seek($z, $position, $whence);
Provides a sub-set of the "seek" functionality, with the restriction that it is only legal to seek forward in the input file/buffer. It is a fatal error to attempt to seek backward.
tell
Usage is
$z->tell() tell $z
Returns the uncompressed file offset.

So yes, you can, but of course it can not be as easy as with an uncompressed file.