Just a quick reply: $lambda = function() { function q() {...} } binds q local to $lambda. If you wrap the include("java.inc"), all bindings should be local to that function.
View entire thread