#!/usr/bin/perl -w # (might as well make it "cross-platform") require 5.008 require PerlIO::gzip; open FIL, ">:gzip", "C:/test.gz" or die "oops: $!"; print FIL "This behaves like any other file handle, but output gets gzipped\n"; close FIL;