Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 pondering the Monastery: (11)
As of 2019-10-16 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?