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

In Perl you can read the input file into a array and find the length of the array.(everyline is a scalar now)divide that into 5 and write those into five files one by one in a loop.