in reply to Perl in CGI

More than likely, you saved the file with windows new lines. Hopefully, your editor has an option to save it as unix.