The first reply raises a good point -- your terminology seems a bit confused.
If you really do want to use GNU gzip-style compression to read and/or write files with gzip-compressed data, the easiest way to do this (IMO) is with PerlIO::gzip -- which makes use of the Perl 5.8.x "IO-layers":
#!/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 gz
+ipped\n";
close FIL;
Note that PerlIO::gzip is not (yet) part of the Perl 5.8.x standard distribution (I wish it was) -- you have to get it from CPAN.
UPDATE: (2010-10-18) It seems that PerlIO::gzip should be viewed as superseded by PerlIO::via:gzip. (see PerlIO::gzip or PerlIO::via::gzip).