in reply to Script to create huge sample files

Did you even actually try to change your pseudocode into a perl script? It looks as though you've been given a task to do at work and just pasted your requirements here.