in reply to Re: passing refs to subs
in thread passing refs to subs

It's not entirely clear what you're trying to do in your question, but you're a little confused about the syntax.

To be able to call &var, there has to be an entry in the `var' stash's subroutine knob. In other words, you'd need to do this:

local *var = sub { ... }

So whatever you're doing above, if you're expecting $bar->foo() to return a subroutine reference, just stick it on the right side of my code there.

And yes, by doing this, you eliminate the dereferecing step. However, see tilly's response to this node where I mention this technique for reasons why this isn't generally all that useful.

-dlc