my $i =0; open (FILE, "myfile.txt"); while () { ++$i; if($. == 10) { print $_; print "\n Reached\n" } } print $i;#will print number of lines in the file