http://www.perlmonks.org?node_id=697781

carterniall has asked for the wisdom of the Perl Monks concerning the following question:

I have a perl script which can print either XML or KMl depending on teh choice of the user. When teh script is run through a browser the user is given the choice of what to do with the file.

I was wondering if there would be a method of allowing them to download and save it as a .XML or .KML extension instead of a .PL extension. I want them to only see it as XML or KML as opposed to a perl script. Any clues as I am coming up stumps.

I have tried changing the content type to: "Content-type: application/vnd.google-earth.kml+xml\n\n"; which was good until they new version of Google Earth stopped that. This method did not help my problem of offering an XML version (.xml) to download though.

Any clues? Sorry if it's a bit vaige but would be more than happy to elaborate...

Niall