http://qs321.pair.com?node_id=11100198


in reply to how to get length of each line of file with spaces

You've been given some good solutions already, and my guess is that if you use a regex substitution (s/\t/    /g) or the tr//: transliteration operator, you probably no longer need to keep track of the line number. But if you need to track the line number for some other reason, please be advised that the $. special variable does that automatically for you (it reports the current input line number of the last file handle that was read).