Am I right that there is no clean way to pass an anonymous block to a method?
Basically, it would be really convenient if this worked:
package something; sub new{ bless {}, __PACKAGE__ } sub doit ($&$) { local $_ = $_[0]->{ $_[2] }; $_[1]->(); } ... package main; my $o = something->new; $o->doit{ $_ += 1 }, 'fred';
In reply to Passing an anonymous block to a method. by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |