in reply to splitting a file
Sounds like you want the unix tool split.
It's pretty simple to do in Perl too. What have you tried?