control flow last

Documentation for control flow last, assembled from the following types:

language documentation Control Flow

From Control Flow

(Control Flow) control flow last

The last command immediately exits the loop in question.

my @x = 12345;
for @x -> $x {
    last if $x == 3;
    print $x;
}

prints "12".