in reply to Re: confusion with Chomp
in thread confusion with Chomp
In this case, chomp removes 2 bytes at the end of the string (on Windows), the "\r\n" characters.
The behavior of chomp is independent of OS. Perl's I/O operators translate whatever our operating system uses for a newline into a perl newline character. (This conversion is not necessary in UNIX.) Even in windows, The default value for $INPUT_RECORD_SEPARATOR is "\n". As your reference specifies, this is what is removed by chomp.
The only documentation I can find for this is in binmode. The primary purpose of binmode is to turn off the newline translation. Perhaps someone can provide a more direct reference.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: confusion with Chomp
by Marshall (Canon) on Apr 08, 2016 at 19:19 UTC |