One of the most simple things you can do with Perl, is process text files. For that, you usually use the diamond operator, you chomp the read line, and process, line by line.
This is great and works mostly of the times.
Or, in the other hand, works when you can control where your files, the ones being processed, come from.
Because, if you want to make a generic application, you need to know that when running on Unix, chomp will remove the newline, but not the carriage return character, unlike when the same script is run under windows.
And I think that is annoying.
Why should we base on the architecture we are running on and not in the file we are processing?
If there any situation where, when reading line by line, we want chomp to maintain the carriage return if it is there?
I know chomp removes the character defined by $/, and this character is different from operating system to operating system.
But is this behavior the one we really mean?
Or am I missing something, and there is something I can do with file handles (IO::Handle, afaik) that will guess the line ending?