I am developing a QC tool, which will scan text files and will create a log report. This seems to be a simple task with the help of Regex. However the user wants log file to tell the line numbers, where the doubtful occurance is present. For e.g. The user dosen't want the word "Cell" in the text file, then the script should tell at what line the Word "Cell" is preset. (This is a simple case, But I needed to use complex Regex to get doubtful occurances).
for e.g. if $ctfilebuf contains all the data taken from a file
while ($ctfilebuf =~ m/Cell/ig)
print "Word \"Cell\" found at line number ......\n";
Here How can I print Line Number? Is there any simple way?