directly to modify the AST of a subroutine on the fly
in reply to Re^3: How to get code of the calling function or object
in thread How to get code of the calling function or object
I think the issue is that Perl produces an optree rather than an abstract syntax tree;the optree directly represents Perl's concrete syntax while with an AST you have a more abstract view
I am under the impression that Perl 6 as well as the other languages for Parrot will output ASTs which will map onto a Parrot Abstract Syntax Tree.
One main reason for that is tree transformation/manipulation which allow things that the OP asked for
The .NET DLR is a an example of that.It calls the DLR AST as Expressions, which is represented by an intermediate Expressions language;this allows for a myriad of neat tricks.You might want to check Expression Tree Basics