in reply to Escape character being escaped in array push
Because the text in the file is not a newline character. It's a backslash plus the character "n".
When you use Data::Dumper to print out a variable, it tries to escape all characters that need escaping to make it a valid string usable in Perl source code. As a Backslash would be used in a string as escape character, it needs escaping (double backslash), in order to produce a string that represents the original text (e.g. a backslash and the character "n").
You can check this with a hex editor (or "hexdump -C" on Linux) on the original text file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Escape character being escaped in array push
by mdunnbass (Monk) on Apr 05, 2022 at 00:11 UTC |