in reply to How do I split a file by lines into smaller files

Here is my contribution...
$lines = 56; $filename = 'chapterx.html'; $nameformat = 'chapterx_page_%d.html'; open(INFILE, "<$filename") or die $!; while(<INFILE>) { if ($. % $lines == 1) { open(OUTFILE, '>'.sprintf($nameformat, $. / $lines + 1)) or di +e $!; } print OUTFILE $_; }