The way I did it I don't think the global scope of that global variable will ever contain an object, so I wasn't too worried about that part
You know, I think you're right about that, which makes me think this never would have worked anyway. The $self referred to by your debug method is the our $self, which never has anything in except in a local scope.
Using my obviously wouldn't work since debug wouldn't be able to get to it, and I think just omitting the local would cause re-entrancy issues. So local seemed like the only solution.
That's kind of what I was getting at: when local is the answer, it usually means you're asking the wrong question. It is very useful in a couple of specific cases though, so I can't say it shouldn't ever be used.
In reply to Re^3: Short invocation for per-object methods
by perrin
in thread Short invocation for per-object methods
by Crackers2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |