in reply to how to get length of each line of file with spaces
Because a TAB is a single ASCII character represented by one octet / byte (pay no attention to the Unicode behind the curtain . . .); it's only by convention that it's displayed as four (or two, or eight, or . . .). You'd need to do something to expand it to spaces (e.g. s{\t}{ }gx) before you count if you're going to use length.
Edit: Also, ALWAYS CHECK THE RETURN VALUE FROM open.
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to get length of each line of file with spaces
by Eily (Monsignor) on May 17, 2019 at 19:38 UTC | |
by afoken (Chancellor) on May 18, 2019 at 09:53 UTC |