$ perl -MCGI -e 'my $q = CGI->new(); print $q->header(-type=>"text/xml"); print $q->header(-attachment=>"filename.xml");' Content-Type: text/xml; charset=ISO-8859-1 Content-Disposition: attachment; filename="filename.xml" Content-Type: text/html; charset=ISO-8859-1