#!perl -wt use strict; use warnings; use utf8; use bytes; use encoding 'utf8'; use Compress::Zlib; my $content; foreach ('aa'..'ZZ') { $content .= $_; } $content = Compress::Zlib::memGzip($content); my $clength = bytes::length($content); print qq~Status: 200 OK Content-Type: text/plain; charset=utf-8 Content-Length: $clength Content-Encoding: gzip $content~; 1;