Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: what would you like to see in perl5.12?by Joost (Canon) |
on Aug 21, 2007 at 23:52 UTC ( [id://634216]=note: print w/replies, xml ) | Need Help?? |
prototypes on methods, so that I can do
hey, a man can dream :-) update: ysth wanted to know what the prototype for my example was. I'll explain. First, I'll note I posted this originally because the OP made me think of Re: Automatic Loop Counter not in perl. But that may not be clear enough.
So, anyway, one of the things I do quite a lot is pass around code blocks (or That means I do a lot of stuff like Which just looks ugly. Especially when compared to or even Sadly, that doesn't work for methods, since method calls ignore prototypes. In other words, I'd just like to pass "sub { # code block }" to "$object->method()" if "method" is declared with a "&" prototype. updated fixed syntax in example.
In Section
Meditations
|
|