Seiler Thomas wrote:

So... lets call a function instead:

    my $is_ok = 1;
    for 0..6 -> $t {
        if abs(@new[$t] - @new[$t+1]) > 3 {
            $is_ok = 0;
            last;
        }
    }
    if $is_ok {
        yada()  # has sideeffects...
    }


That's just:

    for 0..6, 'ok' -> $t {
        when 'ok' { yada() }
        last if abs(@new[$t] - @new[$t+1]) > 3;
    }

;-)

Damian





Reply via email to