use CGI; my $cgi = CGI->new; ... print $cgi->header(-type=>'text/html', -charset=>'utf-8'); #### Content-Type: text/plain; charset="utf-8"