If you upload your file to the server via FTP then it will automatically convert the line endings on transfer (assuming you dont use binary mode transfer). Or you can use an editor that can handle unix line endings in the first place. www.ultraedit.com is one such editor (and my preference). Lastly you could use dos2unix from any one of many sources such as www.cygwin.com.
While making your code resilient to this kind of problem is one solution, IMO the better solution is to just avoid the problem in the first place. If you are going to use files from hetergeneous architectures then decide on a format that you will use on all of them and stick to it.
In reply to Re: Chomp doesn't seem to work
by demerphq
in thread Chomp doesn't seem to work
by JaredHess
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |