I have thought about finding the number of lines in file using a different loop and iterating the line variable inside the inner loop of foo() .
www.google.com.tw