On Mon, 14 Oct 2002 16:35:21 -0400, Bernie Cosell wrote:

>I think they're referring to the '..' operator in scalar context:
>
>    In scalar context, ".." returns a boolean value.  The operator is
>    bistable, like a flip-flop, and emulates the line-range (comma)
>    operator of sed, awk, and various editors....

Actually, it's more than just a boolean: it returns a counter number for
each time it evaluates to true, with an "E0" appended if the second
condition is true, i.e. the last time. That counter is then reset for
the next run.

        for (1 .. 19) {
            $result = $_%5==0 .. $_%3==0;
            print "$_ -> $result\n" if $result;
        }
-->
        5 -> 1
        6 -> 2E0
        10 -> 1
        11 -> 2
        12 -> 3E0
        15 -> 1E0

Note that the three dots operator, "...", will behave differently in
this last case.

-- 
        Bart.

Reply via email to