http://www.perlmonks.org?node_id=481132


in reply to Split a file

Take a look at split and File::Split.