Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: how to get length of each line of file with spaces

by Laurent_R (Canon)
on May 17, 2019 at 17:59 UTC ( #11100198=note: print w/replies, xml ) Need Help??


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).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11100198]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2020-10-01 05:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (175 votes). Check out past polls.

    Notices?