if ($ENV{MOD_PERL}) { use Apache; my $r = Apache->request; $r->content_type("text/html"); $r->send_http_header; } else { print $cgi->header(); }