Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Finding Line numbers in a file

by ferreira (Chaplain)
on Apr 04, 2007 at 14:13 UTC ( #608283=note: print w/replies, xml ) Need Help??


in reply to Finding Line numbers in a file

You're looking for the special variable $. (or its long-form variant, $INPUT_LINE_NUMBER, available when you use English). See perlvar.

If you use IO::Handle, you will be able to use $io->input_line_number (on IO objects) or input_line_number( H ) (on filehandles).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2019-03-21 01:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How do you Carpe diem?





    Results (105 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!