#!/usr/bin/perl use strict; use warnings; use CGI::Ex; my $cgix = CGI::Ex->new; my $my_flush; if (! $cgix->mod_perl_version) { $| = 1; $my_flush = sub {}; # no op } else { $my_flush = sub { # works on most apache versions $cgix->apache_request->rflush; }; } $cgix->print_content_type; print "...\n"; $my_flush->(); sleep 5; print "The rest...\n";