> >> open(LOG, "gunzip $file |") or die "Cannot gunzip '$file': $!"; > > open(FILE, "gunzip $fileLoc |") or die "Cannot gunzip '$fileLoc': $!"; You really want: gunzip -c