You did all this to avoid typing a couple of arrows? I think your lazy-meter is going in the wrong direction here.
In short, putting an object into a global variable is only a good idea if you want a singleton. Also, use of local() is kind of a last resort these days. I use it in a couple of situations where it's dramatically easier than the alternative, but there aren't many of those. It's likely to trip you up at some point.
You could easilly simplify to $self->debug($text) with no risk, just by making a debug() method that calls $self->{'debug'}. If you really want the debug code ref to differ by object, that's as good as you're likely to get without doing risky things.
In reply to Re: Short invocation for per-object methods
by perrin
in thread Short invocation for per-object methods
by Crackers2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |