in reply to read bytes from compressed file

If you're using Perl 5.8.0 or higher, you might want to try PerlIO::gzip.

Otherwise I've personally always used an external unzipper in a pipe:

open (my $handle,"gunzip -c $filename |" ) or die $!;

Liz