ZiaTioN wrote:For future reference another thing that can cause this is if you had to upload the file via ftp or sftp to a remote server and did so in binary mode.
If you upload a text file in binary mode it adds ^M's (CTRL+M) to the end of every line and therefore the perl interpreter freaks out when it sees this and generates the exact error you spoke of.
Actually that's not true. FTPing a file in binary mode does not "add" carriage returns. If it does then your FTP server is broken. In binary mode it should not change anything on the transfer.
A text file in DOS/Windows uses CR+LF (carriage return + line feed) to terminate lines where in UNIX/Linux only LF is used to terminate lines. Now, if you transfer a DOS formatted file from DOS/Windows to a UNIX/Linux via FTP in "ascii" mode then the CRs should get stripped off. In binary mode they will not and thus cause your problem.
If you don't ever use DOS/Windows you should never run into this issue. ;)