in reply to output a file from perl online
Content-Disposition: Attachment; filename=somefile.dat [download]
print <<"THANKS"; Content-Type: application/kml; charset=us-ascii Content-Disposition: attachment; filename="attach.dat"\n\n [download]