in reply to Split a file

Take a look at split and File::Split.