#!/usr/bin/perl -w use strict; my $fh; open($fh, "| gzip -c > outfile.gz") || die $!; print $fh "hello there\n";