in reply to Line number in a file

Your code doesn't show how you process your file initially but maybe you don't know the special variable $.
while (<FILE>) { if (/what not/) { print "We found what not in line $.\n"; } }
more info perlvar

pelagic