1 package DX::Op::OneEach;
8 has var_name => (is => 'ro', required => 1);
10 has each_of => (is => 'ro', required => 1);
12 has each_body => (is => 'ro', required => 1);
15 my ($self, $state) = @_;
16 my ($this, @rest) = @{$self->each_of};
17 my $next_op = (@rest ? $self->but(each_of => \@rest) : $self->next);
18 my $ret_op = DX::Op::SetScope->new(
19 scope => $state->scope, next => $next_op
21 $state->assign_vars($self->var_name => { bound_value => $this })
22 ->push_return_then($ret_op, $self->each_body);