On Wed, 6 Sep 2000 16:24:41 -0500 , Garrett Goebel wrote:

>> >       grep { $a > $_ and last } @b)
>> 
>> So "last" should return true, or what?
>
>The last operator doesn't return anything does it? It immediately exits the
>loop/block in question.

But then, what is the value that would be returned to grep()? If you use
0 as the last value evaluated inside the block, grep() would return an
empty list, 0 in scalar conetxt, and all your tests woukld be in vain.

So: should 

        scalar grep { 1 and last } LIST

return 1, if LIST is not empty, and

        scalar grep { 0 or last } LIST

return 0?

If that is not dealt with, last inside a grep block will never work.

-- 
        Bart.

Reply via email to