use CGI qw( :cgi ); print(header(-type => 'application/xml')); ... print XML here ... #### print("Content-Type: application/xml\n"); print("\n"); ... print XML here ...