There are examples all around us of using Perl for code generation:
in reply to Code Generation with Perl?
- CGI: Perl is probably the number one tool used in generating HTML code for CGI.
- SQL: Perl is often used to generate SQL code for database interaction.
- The B::.... modules (need I say more?).
- eval (it's mere existance....)
Those are just some very common and familiar examples. They're so familiar and seem in many cases so effortless that we forget Perl is generating code. But honestly, if Perl is "The Glue of the Internet", it is that because it excells at gluing things together, and often includes outputting code that some other entity can utilize.
"If I had my life to do over again, I'd be a plumber." -- Albert Einstein