# Send the content type my $name = "testing.xls"; print "Content-disposition: attachment; filename=$name\n"; print "Content-type: application/vnd.ms-excel\n\n"; # Redirect the output to STDOUT my $workbook = Spreadsheet::WriteExcel->new("-"); my $worksheet = $workbook->addworksheet(); $worksheet->write(0, 0, "This should work."); $worksheet->write(0, 1, "In theory."); $workbook->close();