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.
In reply to Re: how to get length of each line of file with spaces
by Fletch
in thread how to get length of each line of file with spaces
by phoenix007
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |