in reply to Re^3: Overridding subroutines called in private subroutines
in thread Overridding subroutines called in private subroutines

Be careful. The braces ({}) don't localize everything you are doing. The create a scope for your variables, but your package and subroutine declarations remain global.

No, that's wrong. package is lexically scoped. That's why you don't have to switch it back after a module changes it.

print(__PACKAGE__, "\n"); { package Foo; print(__PACKAGE__, "\n"); } print(__PACKAGE__, "\n");
main Foo main