in reply to Giving subroutines access to themselves

I agree this is a nifty idea, but if all you want is to refuse to do something if certain conditions are met, what's wrong with:

return if $balance <= 0;

Why is it necessary to blow the subroutine away?

Replies are listed 'Best First'.
Re^2: Giving subroutines access to themselves
by diotalevi (Canon) on Dec 17, 2002 at 19:46 UTC

    It's a bit more about revoking the method. I think that if I were to write self-revoking subroutines that I'd be operating in an environment where an object returns a method (read capability) keeping a copy of the object and itself as a closure. This is what an object revoking access from another object might look like. Or maybe not. Anyhow this is just a tool - whether it's a particularly good one or not... I don't know yet.