open(IN, sprintf("zcat %s |", $filename)) or die("Can't open pipe from command 'zcat $filename' : $!\n"); while () { # process lines } close(IN);