Well, Perl is on a level not many languages dare touch. If I'm not mistaken, you can execute arbitrary code during compilation and generate arbitrary source. Which in turn might be executed to generate more stuff...
But code generation and execution during runtime, which is what I think you meant, is capable in any language with eval().
Perl claims to have a compilation stage, by which the documentation means that the lexer and parser produce an optree, which the runtime phase traverses. During that compilation stage, it's possible to run code which changes how the parser will treat subsequent syntactic elements.