in reply to Any security holes?

Check out CGI::Tiny. Also, why are you writing this to a file and not returning the content to the parent process?