Your filehandle is a lexical FH, so you can pass it as an argument, just as other variables. As for SEM, I don't really see what you are talking about. Check the caller EXPR syntax, I don't remember the exact details, but you can specify the number of stack frames to go back.