I believe your fundamental assumption that Apache+perl does not allow you to create or write files is mistaken. (I've certainly done it in the past.) Could you be trying to write files someplace where you don't have the proper permissions? Have you tried creating a writeable directory outside the Apache docroot and creating your files there? What kind of error message are you getting when you try to write the files?