print "Content-type: text/csv\n"; #Changed content-type to CSV print "Content-Disposition: attachement; filename=test.xls\n\n"; print $excel;