in reply to how can I get here?

PPI analyzes your source code and gives you a tree representation. I guess you can then search that tree for references (by name) to your subroutine and then visit the parents of these references until you find an enclosing named subroutine.