role CX::Next does X::Control { }

A control exception that is triggered when next is called.

for ^10 {
    CONTROL {
      when CX::Next { say "We're next" };
    }
    next if $_ %% 2;
    say "We're in $_";
}

This will print:

We're next
We're in 1
We're next
We're in 3
We're next
We're in 5
We're next
We're in 7
We're next
We're in 9

Methods§

method message§

method message()

Returns '<next control exception>'.