in reply to perl to generate VHDL code
Have you looked at Template or any of the other templating systems? Using those, you can write your code and have it generate more code.