Here's your problem:
print "Content-type: application/vnd.ms-excel\n"; #print "Content-Disposition: attachment; filename=$filename\n\n";
HTTP headers need to end in a double line break. Your Content-Type header has only one. Your Content-Disposition header would do the trick, but it's commented out.
In reply to Re^5: capturing STDOUT
by tobyink
in thread capturing STDOUT
by nop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |