in reply to Giving subroutines access to themselves

An alternative approach is to use objects, and bless.

Imagine an Account class (an abstract base). Create two subclasses: ActiveAccount and DisabledAccount. You can now create

ActiveAccount::disable { my ($self) = @_; bless $self, "DisabledAccount"; }
The reblessed object will no longer have access to the methods in ActiveAccount. --Dave