in reply to split a file into number of file based on line count

update: You can use "$." for counting lines.
my $i =0; open (FILE, "myfile.txt"); while (<FILE>) { ++$i; if($. == 10) { print $_; print "\n Reached\n" } } print $i;#will print number of lines in the file
You can use an array to store the file and use scalar @arr to get the array size.
Raghu