use CGI qw( :cgi ); print(header(-type => 'application/xml')); ... print XML here ...