open(INPUT, "/usr/bin/gzip -d -c '$filename' |") open(OUTPUT, "| /usr/bin/gzip > '$filename'"); while() { # munge print OUTPUT; } close INPUT; close OUTPUT;