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


in reply to Finding Line numbers in a file

do you have to have the whole file in $ctfilebuf? It will be a lot easier if you simply read/scan it line by line .. you can keep a counter of the line numbers (or use the $. variable -- see perlvar)
Also, grep -n Cell log.txt from the commandline accomplishes this as well