open(handle, "c:\\file.log"); while() { #here i use regular expression for parsing line #here i print parse information } now i want it as follow function(filepath, numberofline)#return number of line while() { #here i use regular expression for parsing line #here i print parse information }