I'm trying to make a perl script that returns XML instead of HTML.

my script currently looks like this...

Code:
#!/usr/bin/perl

#
#print xml info
print "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
print "<programlist>\n";
print "</programlist>\n";
which creates the following xml file
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<programlist>
</programlist>
this works fine if i save the output to a file and view it in a browser however if i run the perl script in my browser I get a "500 Internal Server Error".

Looking at the apache error log i get

Code:
malformed header from script. Bad header=<?xml version="1.0" encoding=": /usr/local/apache/cgi-bin/getChannels.pl
does anyone know how to stop this???

Thanks for your help

Mrs K