Context propagates.
sub handle_mutator { my ($self,$cb)=@_; my $obj; if (defined wantarray) { $obj = $self->copy(); } else { $obj = $self; }; $cb->($obj,@_); } sub something { shift->handle_mutator(sub{ .... }); }
In reply to Re: How to best pass on the context / wantarray?
by demerphq
in thread How to best pass on the context / wantarray?
by Corion
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |