Thanks! Just what I needed. I'm not actually going to edit or re-eval the code from the coderef, but getting it into string form means I can then work out whether the same code has been passed in before, such that a cached result can be returned. Conveniently, that means I also don't have to worry about the specific code formatting used by B::Deparse either :-)