How can I find the current position in a file?
I just can count total numbers in a file.
I've read about functions tell() and seek() but I don't understand how exactly to use them.
When you are reading from a file (filehandle, actually), you can use $. to find out the line number of current input line. To reset the value of $., you need to close the current input filehandle.