It can be DOS newlines have been appeared on file transfer from one place to another. They looks like '^M' characters at end of lines in vi or emacs editors
Upd: I missed that your script doesn't print http header. Please insert print header(); before any print
In reply to Re: Malformed Header Error
by ccn
in thread Malformed Header Error
by macPerl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |